MFF

    Minecraft Forge France
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes
    • Forge Events
      • Automatique
      • Foncé
      • Clair
    • S'inscrire
    • Se connecter

    [1.7.10] - Barre d'Xp de métier Custom non syncronisée

    Planifier Épinglé Verrouillé Déplacé Résolu 1.7.x
    1.7.10
    41 Messages 8 Publieurs 3.5k Vues 5 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • D Hors-ligne
      Driss2003
      dernière édition par

      J’ai essayé de corriger les erreurs mais je n’arrive pas a comprendre tes solutions (car j’ai toujours des erreurs), essaye d’envoyer le code source, je comprendrai mieux avec des images.

      1 réponse Dernière réponse Répondre Citer 0
      • JustAnDevJ Hors-ligne
        JustAnDev
        dernière édition par

        Je n’ai pount de code source chez moi reprensetant (Daich Mod est actuellement sur GitHub (ne contient pas de money) et SAOII étant deleted!)

        s

        1 réponse Dernière réponse Répondre Citer 0
        • D Hors-ligne
          Driss2003
          dernière édition par

          Ou alors essaye de montrer tes codes (surtout pour le Xp Jobs etc…) s’il te plait pour que comprenne mieux.

          1 réponse Dernière réponse Répondre Citer 0
          • JustAnDevJ Hors-ligne
            JustAnDev
            dernière édition par JustAnDev

            j’ai dit que j’en ai pas pour le moment

            s

            1 réponse Dernière réponse Répondre Citer 0
            • D Hors-ligne
              Driss2003
              dernière édition par

              Ok merci quand meme d’avoir repondu

              1 réponse Dernière réponse Répondre Citer 0
              • D Hors-ligne
                Driss2003
                dernière édition par

                Par contre j’ai toujours une erreur ici: ac4bc638-41fb-414e-9872-bbdfc6f557e6-image.png

                1 réponse Dernière réponse Répondre Citer 0
                • JustAnDevJ Hors-ligne
                  JustAnDev
                  dernière édition par

                  Classe complete (revois le tuto sur les packets(1.7.2+) tu vas comprendre pourquoi)

                  s

                  1 réponse Dernière réponse Répondre Citer 0
                  • D Hors-ligne
                    Driss2003
                    dernière édition par robin4002

                    package com.mod.sunwhy.GuiContainer;
                    
                    import com.mod.sunwhy.ModTuto;
                    import com.mod.sunwhy.proxy.CommonProxy;
                    
                    import cpw.mods.fml.common.network.simpleimpl.IMessage;
                    import net.minecraft.entity.DataWatcher;
                    import net.minecraft.entity.Entity;
                    import net.minecraft.entity.player.EntityPlayer;
                    import net.minecraft.entity.player.EntityPlayerMP;
                    import net.minecraft.nbt.NBTTagCompound;
                    import net.minecraft.world.World;
                    import net.minecraftforge.common.IExtendedEntityProperties;
                    
                    public class jobHandler implements IExtendedEntityProperties{
                    	
                    	   public final static String EXT_PROP_NAME = "ExtPropTuto";
                    	   
                    	    private final EntityPlayer player;
                    	 
                    	    public long money;
                    	    public long maxMoney;
                    		
                    		
                    		protected DataWatcher dataWatcher;
                    
                    		
                    	
                    	    
                    	public jobHandler(EntityPlayer player) {
                         this.player = player;
                         this.money = 0;
                         this.maxMoney = 200;
                    
                    	}
                         public static final void register(EntityPlayer player) {
                         player.registerExtendedProperties(jobHandler.EXT_PROP_NAME,
                                 new jobHandler(player));
                     }
                    
                     public static final jobHandler get(EntityPlayer player) {
                         return (jobHandler) player.getExtendedProperties(EXT_PROP_NAME);
                     
                     }
                     @Override
                     public void saveNBTData(NBTTagCompound compound) {
                    
                         NBTTagCompound properties = new NBTTagCompound();
                    
                         properties.setLong("Money", this.money);
                         properties.setLong("MaxMoney", this.maxMoney);
                         compound.setTag(EXT_PROP_NAME, properties);
                     }
                    
                     @Override
                     public void loadNBTData(NBTTagCompound compound) {
                         NBTTagCompound properties = (NBTTagCompound) compound
                                 .getTag(EXT_PROP_NAME);
                         this.money = properties.getLong("Money");
                         this.maxMoney = properties.getLong("MaxMoney");
                     
                     }
                     
                    	@Override
                    	public void init(Entity entity, World world) {
                    		
                    		
                    	}
                         public final void sync()
                         {
                             if (!player.worldObj.isRemote)
                             {
                                 EntityPlayerMP player1 = (EntityPlayerMP) player;
                                 ModTuto.d.sendTo((IMessage)new PacketMoney(), player1);
                             }
                             else
                             {
                                 PacketMoney packetcaracteristique = new PacketMoney(this.maxMoney , this.money);
                                 ModTuto.d.sendToServer((IMessage)new PacketMoney());
                             }
                         }
                    
                    	private static String getSaveKey(EntityPlayer player) {
                         return player.getDisplayName() + ":" + EXT_PROP_NAME;
                     }
                     public static void saveProxyData(EntityPlayer player) {
                         jobHandler playerData = jobHandler.get(player);
                         NBTTagCompound savedData = new NBTTagCompound();
                    
                         playerData.saveNBTData(savedData);
                         CommonProxy.storeEntityData(getSaveKey(player), savedData);
                     }
                    
                     public static void loadProxyData(EntityPlayer player) {
                         jobHandler playerData = jobHandler.get(player);
                         NBTTagCompound savedData = CommonProxy
                                 .getEntityData(getSaveKey(player));
                    
                         if (savedData != null) {
                             playerData.loadNBTData(savedData);
                         }
                         playerData.sync();
                     }
                     public boolean pay(long amount) {
                         boolean sufficient = amount <= this.money;
                    
                         if (sufficient) {
                             this.money -= amount;
                             this.sync();
                         } else {
                             return false;
                         }
                    
                         return sufficient;
                     }
                    
                     public void addMoney(long amount) {
                         this.money += amount;
                         this.sync();
                     }
                    
                     public long getMoney() {
                     	 
                         return this.money;
                        
                     }
                    
                     public void setMoney(long newMoney) {
                         this.money = newMoney;
                         this.sync();
                     }
                     public void update(long money, long maxMoney){
                     	
                     }
                    	public long getMaxMoney(long money2) {
                    	
                    		return this.maxMoney;
                    	}
                    	    
                    }
                    
                    1 réponse Dernière réponse Répondre Citer 0
                    • D Hors-ligne
                      Driss2003
                      dernière édition par

                      J’ai un crash quand je ouvre le GUI (j’ai essayé de resoudre les erreurs):

                      [15:50:45] [Client thread/FATAL]: Reported exception thrown!
                      net.minecraft.util.ReportedException: Rendering screen
                      at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1168) ~[EntityRenderer.class:?]
                      at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1067) ~[Minecraft.class:?]
                      at net.minecraft.client.Minecraft.run(Minecraft.java:962) [Minecraft.class:?]
                      at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211]
                      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_211]
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_211]
                      at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_211]
                      at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
                      at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
                      at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
                      at GradleStart.main(Unknown Source) [start/:?]
                      Caused by: java.lang.NullPointerException
                      at com.mod.sunwhy.GuiContainer.GuiJobs.drawScreen(GuiJobs.java:66) ~[GuiJobs.class:?]
                      at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1137) ~[EntityRenderer.class:?]
                      … 11 more
                      [15:50:45] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: ---- Minecraft Crash Report ----
                      // Who set us up the TNT?

                      Time: 13/06/19 15:50
                      Description: Rendering screen

                      java.lang.NullPointerException: Rendering screen
                      at com.mod.sunwhy.GuiContainer.GuiJobs.drawScreen(GuiJobs.java:66)
                      at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1137)
                      at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1067)
                      at net.minecraft.client.Minecraft.run(Minecraft.java:962)
                      at net.minecraft.client.main.Main.main(Main.java:164)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                      at java.lang.reflect.Method.invoke(Unknown Source)
                      at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
                      at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
                      at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
                      at GradleStart.main(Unknown Source)

                      A detailed walkthrough of the error, its code path and all known details is as follows:

                      – Head –
                      Stacktrace:
                      at com.mod.sunwhy.GuiContainer.GuiJobs.drawScreen(GuiJobs.java:66)

                      – Screen render details –
                      Details:
                      Screen name: com.mod.sunwhy.GuiContainer.GuiJobs
                      Mouse location: Scaled: (213, 119). Absolute: (427, 240)
                      Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2

                      – Affected level –
                      Details:
                      Level name: MpServer
                      All players: 1 total; [EntityClientPlayerMP[‘Player974’/110, l=‘MpServer’, x=-254,30, y=66,62, z=239,98]]
                      Chunk stats: MultiplayerChunkCache: 350, 350
                      Level seed: 0
                      Level generator: ID 00 - default, ver 1. Features enabled: false
                      Level generator options:
                      Level spawn location: World: (-256,64,240), Chunk: (at 0,4,0 in -16,15; contains blocks -256,0,240 to -241,255,255), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
                      Level time: 17120 game time, 17120 day time
                      Level dimension: 0
                      Level storage version: 0x00000 - Unknown?
                      Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
                      Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
                      Forced entities: 54 total; [EntityZombie[‘Zombie’/14, l=‘MpServer’, x=-328,50, y=14,00, z=196,50], EntityZombie[‘Zombie’/15, l=‘MpServer’, x=-331,69, y=24,00, z=264,03], EntityZombie[‘Zombie’/16, l=‘MpServer’, x=-330,16, y=24,00, z=265,47], EntityZombie[‘Zombie’/17, l=‘MpServer’, x=-334,34, y=24,00, z=263,31], EntityCreeper[‘Creeper’/19, l=‘MpServer’, x=-330,13, y=25,00, z=283,25], EntityZombie[‘Zombie’/20, l=‘MpServer’, x=-330,50, y=20,00, z=276,50], EntitySkeleton[‘Skeleton’/21, l=‘MpServer’, x=-330,09, y=18,00, z=283,47], EntityCreeper[‘Creeper’/22, l=‘MpServer’, x=-326,41, y=25,00, z=283,00], EntitySkeleton[‘Skeleton’/23, l=‘MpServer’, x=-326,43, y=17,08, z=283,60], EntitySkeleton[‘Skeleton’/24, l=‘MpServer’, x=-325,50, y=16,00, z=286,16], EntityCreeper[‘Creeper’/25, l=‘MpServer’, x=-324,03, y=14,00, z=296,91], EntitySkeleton[‘Skeleton’/26, l=‘MpServer’, x=-325,50, y=16,00, z=290,50], EntityZombie[‘Zombie’/27, l=‘MpServer’, x=-314,50, y=21,00, z=170,91], EntitySpider[‘Spider’/28, l=‘MpServer’, x=-308,06, y=20,00, z=171,66], EntityZombie[‘Zombie’/29, l=‘MpServer’, x=-316,50, y=21,00, z=173,01], EntityZombie[‘Zombie’/30, l=‘MpServer’, x=-316,22, y=20,00, z=175,84], EntityZombie[‘Zombie’/31, l=‘MpServer’, x=-305,50, y=21,00, z=181,50], EntityZombie[‘Zombie’/32, l=‘MpServer’, x=-310,95, y=20,00, z=180,53], EntitySkeleton[‘Skeleton’/33, l=‘MpServer’, x=-307,50, y=21,00, z=184,69], EntitySkeleton[‘Skeleton’/34, l=‘MpServer’, x=-308,50, y=20,00, z=179,50], EntitySkeleton[‘Skeleton’/35, l=‘MpServer’, x=-307,50, y=21,00, z=183,66], EntityCreeper[‘Creeper’/36, l=‘MpServer’, x=-311,63, y=20,00, z=178,03], EntitySquid[‘Squid’/37, l=‘MpServer’, x=-305,08, y=53,32, z=244,36], EntitySkeleton[‘Skeleton’/42, l=‘MpServer’, x=-295,50, y=17,00, z=180,96], EntityCreeper[‘Creeper’/43, l=‘MpServer’, x=-303,97, y=21,00, z=182,47], EntityBat[‘Bat’/44, l=‘MpServer’, x=-294,31, y=19,10, z=184,41], EntityZombie[‘Zombie’/54, l=‘MpServer’, x=-274,09, y=18,00, z=201,59], EntityZombie[‘Zombie’/55, l=‘MpServer’, x=-284,50, y=19,00, z=194,03], EntityCreeper[‘Creeper’/56, l=‘MpServer’, x=-277,09, y=18,00, z=198,31], EntityCreeper[‘Creeper’/57, l=‘MpServer’, x=-274,50, y=18,00, z=199,50], EntityZombie[‘Zombie’/58, l=‘MpServer’, x=-277,66, y=24,00, z=314,34], EntityZombie[‘Zombie’/68, l=‘MpServer’, x=-271,44, y=18,00, z=201,38], EntitySquid[‘Squid’/69, l=‘MpServer’, x=-243,13, y=51,34, z=208,68], EntityBat[‘Bat’/70, l=‘MpServer’, x=-244,22, y=22,89, z=317,59], EntityBat[‘Bat’/71, l=‘MpServer’, x=-240,25, y=23,01, z=317,75], EntityBat[‘Bat’/73, l=‘MpServer’, x=-231,25, y=29,10, z=190,75], EntityBat[‘Bat’/74, l=‘MpServer’, x=-233,50, y=27,64, z=188,09], EntityBat[‘Bat’/75, l=‘MpServer’, x=-237,75, y=23,10, z=317,53], EntityCreeper[‘Creeper’/80, l=‘MpServer’, x=-219,64, y=32,00, z=212,22], EntityCreeper[‘Creeper’/81, l=‘MpServer’, x=-221,50, y=32,00, z=211,66], EntitySpider[‘Spider’/82, l=‘MpServer’, x=-220,13, y=32,00, z=210,98], EntityBat[‘Bat’/83, l=‘MpServer’, x=-205,25, y=24,82, z=237,50], EntityBat[‘Bat’/84, l=‘MpServer’, x=-209,09, y=26,00, z=313,22], EntityBat[‘Bat’/95, l=‘MpServer’, x=-206,09, y=26,39, z=220,31], EntityCreeper[‘Creeper’/96, l=‘MpServer’, x=-205,31, y=23,00, z=232,88], EntityBat[‘Bat’/97, l=‘MpServer’, x=-205,25, y=26,10, z=238,44], EntityBat[‘Bat’/98, l=‘MpServer’, x=-205,25, y=26,10, z=236,47], EntitySpider[‘Spider’/99, l=‘MpServer’, x=-208,41, y=24,00, z=232,94], EntitySkeleton[‘Skeleton’/100, l=‘MpServer’, x=-207,50, y=24,00, z=240,66], EntityBat[‘Bat’/101, l=‘MpServer’, x=-199,25, y=24,00, z=239,97], EntitySquid[‘Squid’/102, l=‘MpServer’, x=-205,95, y=46,78, z=258,10], EntitySkeleton[‘Skeleton’/103, l=‘MpServer’, x=-186,50, y=15,00, z=172,50], EntitySkeleton[‘Skeleton’/105, l=‘MpServer’, x=-184,47, y=17,00, z=179,88], EntityClientPlayerMP[‘Player974’/110, l=‘MpServer’, x=-254,30, y=66,62, z=239,98]]
                      Retry entities: 0 total; []
                      Server brand: fml,forge
                      Server type: Integrated singleplayer server
                      Stacktrace:
                      at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415)
                      at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2566)
                      at net.minecraft.client.Minecraft.run(Minecraft.java:984)
                      at net.minecraft.client.main.Main.main(Main.java:164)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                      at java.lang.reflect.Method.invoke(Unknown Source)
                      at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
                      at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
                      at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
                      at GradleStart.main(Unknown Source)

                      1 réponse Dernière réponse Répondre Citer 0
                      • JustAnDevJ Hors-ligne
                        JustAnDev
                        dernière édition par JustAnDev

                        je peux voir la ligne 66 de GuiJobs (et suis les manieres d’ecrire les classes commencent par une maj
                        MoDaichMod est valide mais modaichmod on pourrait confondre avec une variable)
                        Et pour ton premier probleme (apprends un peu java et) suis le tuto sur les PACKETS! Car c’est simple 1 mettre le ModTuto ne sert a rien retire le ainsi du point qui le suit
                        2 le “d”.sendToServer .Le d est une variable pour packets donc suis les packets et reviens

                        s

                        1 réponse Dernière réponse Répondre Citer 0
                        • D Hors-ligne
                          Driss2003
                          dernière édition par

                          Bon vous savez quoi, j’ai voulu apprendre pendant 2 semaines et je n’ai toujours rien Capter XD. Si une personne me fais ces metiers je lui paye 5 euros (JE veux juste la base du codage pour le metier)

                          1 réponse Dernière réponse Répondre Citer 0
                          • D Hors-ligne
                            Driss2003
                            dernière édition par

                            Bref j’ai a peu prés compris maintenant Minecraft se lance sans crash mais je n’ai pas d’interface, et rien dans le chat disant “tu as recu blablabla”

                            1 réponse Dernière réponse Répondre Citer 0
                            • 1
                            • 2
                            • 3
                            • 1 / 3
                            • Premier message
                              Dernier message
                            Design by Woryk
                            ContactMentions Légales

                            MINECRAFT FORGE FRANCE © 2024

                            Powered by NodeBB