MFF

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

    Faire un compteur de tick (Bar de soif)

    Planifier Épinglé Verrouillé Déplacé Résolu 1.8.x
    1.8.9
    88 Messages 8 Publieurs 16.2k Vues 1 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.
    • Alexandre1156A Hors-ligne
      Alexandre1156
      dernière édition par

      Je viens d’essayer en 1.8.9 (étant donner que je faisait tout en 1.11.2) et la méthode cast n’existe pas. Donc laisse comme c’était avant, et envoies le crash report s’il y en a.

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

        Voici le crash report :

        –-- Minecraft Crash Report ----
        // Hi. I'm Minecraft, and I'm a crashaholic.
        
        Time: 08/05/17 14:31
        Description: Unexpected error
        
        java.lang.NullPointerException: Unexpected error
        at com.survivant.mod.SurvivantThirstBar.onRenderGameOverlay(SurvivantThirstBar.java:83)
        at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_13_SurvivantThirstBar_onRenderGameOverlay_RenderGameOverlayEvent.invoke(.dynamic)
        at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:49)
        at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140)
        at net.minecraftforge.client.GuiIngameForge.post(GuiIngameForge.java:854)
        at net.minecraftforge.client.GuiIngameForge.renderExperience(GuiIngameForge.java:561)
        at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:145)
        at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1135)
        at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1107)
        at net.minecraft.client.Minecraft.run(Minecraft.java:380)
        at net.minecraft.client.main.Main.main(Main.java:116)
        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 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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
        at GradleStart.main(GradleStart.java:26)
        
        A detailed walkthrough of the error, its code path and all known details is as follows:
        ---------------------------------------------------------------------------------------
        
        -- Head --
        Stacktrace:
        at com.survivant.mod.SurvivantThirstBar.onRenderGameOverlay(SurvivantThirstBar.java:83)
        at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_13_SurvivantThirstBar_onRenderGameOverlay_RenderGameOverlayEvent.invoke(.dynamic)
        at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:49)
        at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140)
        at net.minecraftforge.client.GuiIngameForge.post(GuiIngameForge.java:854)
        at net.minecraftforge.client.GuiIngameForge.renderExperience(GuiIngameForge.java:561)
        at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:145)
        
        -- Affected level --
        Details:
        Level name: MpServer
        All players: 1 total; [EntityPlayerSP['Player338'/168, l='MpServer', x=8,50, y=65,00, z=8,50]]
        Chunk stats: MultiplayerChunkCache: 0, 0
        Level seed: 0
        Level generator: ID 01 - flat, ver 0\. Features enabled: false
        Level generator options:
        Level spawn location: -52,00,4,00,414,00 - World: (-52,4,414), Chunk: (at 12,0,14 in -4,25; contains blocks -64,0,400 to -49,255,415), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
        Level time: 0 game time, 0 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: survival (ID 0). Hardcore: false. Cheats: false
        Forced entities: 1 total; [EntityPlayerSP['Player338'/168, l='MpServer', x=8,50, y=65,00, z=8,50]]
        Retry entities: 0 total; []
        Server brand: fml,forge
        Server type: Integrated singleplayer server
        Stacktrace:
        at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:383)
        at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2645)
        at net.minecraft.client.Minecraft.run(Minecraft.java:409)
        at net.minecraft.client.main.Main.main(Main.java:116)
        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 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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
        at GradleStart.main(GradleStart.java:26)
        
        – System Details --
        Details:
        Minecraft Version: 1.8.9
        Operating System: Windows 8.1 (amd64) version 6.3
        Java Version: 1.8.0_121, Oracle Corporation
        Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
        Memory: 658588368 bytes (628 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
        JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
        IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
        FML: MCP 9.19 Powered by Forge 11.15.1.1747 4 mods loaded, 4 mods active
        States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
        UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)
        UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8.9-11.15.1.1747.jar)
        UCHIJAAAA Forge{11.15.1.1747} [Minecraft Forge] (forgeSrc-1.8.9-11.15.1.1747.jar)
        UCHIJAAAA survivant{1.0.0} [Mod Survivant] (bin)
        Loaded coremods (and transformers):
        GL info: ' Vendor: 'Intel' Version: '4.0.0 - Build 10.18.10.3621' Renderer: 'Intel(R) HD Graphics 4000'
        Launched Version: 1.8.9
        LWJGL: 2.9.4
        OpenGL: Intel(R) HD Graphics 4000 GL version 4.0.0 - Build 10.18.10.3621, Intel
        GL Caps: Using GL 1.3 multitexturing.
        Using GL 1.3 texture combiners.
        Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
        Shaders are available because OpenGL 2.1 is supported.
        VBOs are available because OpenGL 1.5 is supported.
        
        Using VBOs: No
        Is Modded: Definitely; Client brand changed to 'fml,forge'
        Type: Client (map_client.txt)
        Resource Packs:
        Current Language: Français (France)
        Profiler Position: N/A (disabled)
        CPU: 4x Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
        
        1 réponse Dernière réponse Répondre Citer 0
        • Alexandre1156A Hors-ligne
          Alexandre1156
          dernière édition par

          Si tu n’as fait aucun changement par rapport à la dernière fois, la ligne 83 correspond à ça :

          
          mc.ingameGUI.drawTexturedModalRect(posX + 1, posY + 1, 0, 9, (int)thirst.getThirst(), 7);
          
          

          Je pense que la variable *thirst *doit être null, ce qui cause le crash.
          Pour voir si j’ai raison, rajoute cette ligne avant :

          
          System.out.println("isThirstNull : "+(thirst == null));
          
          

          Si elle est sur true, il faudrait regarder du côté de le class **CapabilityHandler **et voir si le capability est bien assigné au joueur.
          Conseil : regarde cette vidéo pour apprendre à lire un crash report : https://www.youtube.com/watch?v=Uipvf_DmyQc

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

            Effectivement c’est sur true, par contre dans capabilityHandler j’ai l’impression qu’elle est bien assignée au joueur. Merci par avance.

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

              Pas d’idée pour corriger la class CapabilityHandler ?Car moi je sais pas quoi faire. Merci par avance.

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

                @‘elx9000’:

                Pas d’idée pour corriger la class CapabilityHandler ?Car moi je sais pas quoi faire. Merci par avance.

                Faire du debugging.
                Dans ton cas, vérifier que l’event fonctionne, vérifier que l’event arrive jusqu’à addCapability , vérifier que le capability est bien assigné au joueur, vérifie que THIRST_CAP n’est pas null…

                1 réponse Dernière réponse Répondre Citer 1
                • E Hors-ligne
                  elx9000
                  dernière édition par

                  Justement, je suis désolé mais ça je ne sais pas faire 😉 , comment il faut que je m’y prenne ?

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

                    Il faut que tu mettes des “System.out.println(“fonction truc”);” dans les fonctions concernées, si ça apparaît dans la console c’est bon, sinon c’est quelle n’est pas appelée.

                    Si je vous ai aidé, n'oubliez pas d’être heureux, j'aiderai encore +

                    AymericRed, moddeur expérimenté qui aide sur ce forum et qui peut accepter de faire un mod Forge rémunéré de temps en temps.

                    Mes tutos : Table de craft, plugin NEI, plugin JEI, modifier l'overlay
                    Je suis un membre apprécié et joueur, j'ai déjà obtenu 6 points de réputation.

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

                      J’ai mis un System.out.println(“attachCapability OK”); dans la fonction attachCapability de la class CapabilityHandler, mais cette phrase n’est pas apparu. J’ai compris que c’est le fait que thirstValue soit null mais je n’ai aucune idée pour que ça fonctionne.

                      Merci par avance pour votre aide.

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

                        Dans la class Common Proxy, fais comme ceci :

                        
                        public void registerRenders()
                            {
                               //Tu ne dois rien mettre ici étant donner que le render ne se fait que côté client
                            }
                        
                            public void init(FMLInitializationEvent e)
                            {
                            CapabilityManager.INSTANCE.register(IThirst.class, new ThirstStorage(), ThirstCap.class);
                            MinecraftForge.EVENT_BUS.register(new CapabilityHandler());
                            }
                        
                        

                        Et dans ta class principale :

                        
                         @EventHandler
                            public void init (FMLInitializationEvent event)
                            {        
                                proxy.registerRenders();
                        
                                proxy.init(event);
                        
                                MinecraftForge.EVENT_BUS.register(new SurvivantBlockEvent());       
                                MinecraftForge.EVENT_BUS.register(new SurvivantThirstBar());
                                EntityHandler.RegisterFish(EntityFish.class, "Fish");
                                EntityHandler.RegisterSalmon(EntitySalmon.class, "Salmon");
                                EntityHandler.RegisterRay(EntityRay.class, "Ray");
                            }
                        
                        

                        L’event ne s’enregistré pas étant donné que proxy.registerRenders() ne s’effectue que dans ClientProxy et non dans **CommonProxy *(à moins de mettre super.registerRenders()*).

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

                          OK, le système en lui même fonctionne bien. J’ai fait ceci, mais il reste quelque problème :

                          
                          package com.survivant.mod;
                          
                          import com.survivant.mod.Capabilities.IThirst;
                          import com.survivant.mod.Capabilities.ThirstProvider;
                          
                          import net.minecraft.client.Minecraft;
                          import net.minecraft.entity.player.EntityPlayer;
                          import net.minecraft.potion.Potion;
                          import net.minecraft.potion.PotionEffect;
                          import net.minecraft.util.ChatComponentText;
                          import net.minecraft.util.DamageSource;
                          import net.minecraft.util.ResourceLocation;
                          import net.minecraftforge.client.event.GuiScreenEvent;
                          import net.minecraftforge.client.event.RenderGameOverlayEvent;
                          import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
                          import net.minecraftforge.event.AttachCapabilitiesEvent;
                          import net.minecraftforge.event.entity.player.PlayerEvent;
                          import net.minecraftforge.event.entity.player.PlayerSleepInBedEvent;
                          import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
                          import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
                          import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent;
                          import net.minecraftforge.fml.common.gameevent.TickEvent;
                          
                          public class SurvivantThirstBar
                          {
                             public static int i = 0;
                          
                             @SubscribeEvent
                             public void onPlayerLogsIn(PlayerLoggedInEvent event)
                             {
                                 EntityPlayer player = event.player;
                                 IThirst thirst = player.getCapability(ThirstProvider.THIRST_CAP, null);
                             }
                          
                             @SubscribeEvent
                             public void onPlayerSleep(PlayerSleepInBedEvent event)
                             {
                                 EntityPlayer player = event.entityPlayer;
                                 if (player.worldObj.isRemote)
                                 {
                                     return;
                                 }
                                 IThirst thirst = player.getCapability(ThirstProvider.THIRST_CAP, null);
                             }
                          
                             @SubscribeEvent
                             public void onPlayerClone(PlayerEvent.Clone event)
                             {
                                 EntityPlayer player = event.entityPlayer;
                                 IThirst thirst = player.getCapability(ThirstProvider.THIRST_CAP, null);
                                 thirst.set(86);
                             }
                          
                             @SubscribeEvent
                             public void playerTick(TickEvent.PlayerTickEvent event)
                             {    
                                 EntityPlayer player = event.player;
                                 IThirst thirst = player.getCapability(ThirstProvider.THIRST_CAP, null);
                                 if (!event.player.capabilities.isCreativeMode)
                                 {
                                     i++;
                                     if (i == 800)
                                     {
                                         thirst.consume(1);
                                         System.out.println("thirst = " + thirst.getThirst());
                                         i = 0;
                                     }
                                     if (thirst.getThirst() == 0)
                                     {
                                         event.player.attackEntityFrom(ModSurvivant.damageSourceDehydration, 1.0F);
                                     }
                                 }
                             }
                          
                             @SubscribeEvent
                             public void onRenderGameOverlay(RenderGameOverlayEvent event)
                             {
                                 if (!event.isCancelable() && event.type == ElementType.EXPERIENCE)
                                 {
                                     Minecraft mc = Minecraft.getMinecraft();
                          
                                     if (!mc.thePlayer.capabilities.isCreativeMode)
                                     {
                                         EntityPlayer player = mc.thePlayer;
                                         IThirst thirst = player.getCapability(ThirstProvider.THIRST_CAP, null);
                          
                                         int posX = event.resolution.getScaledWidth() / 2 + 7;
                                         int posY = event.resolution.getScaledHeight() - 50;
                          
                                         mc.renderEngine.bindTexture(new ResourceLocation("survivant:textures/gui/thirstBar.png"));
                                         mc.ingameGUI.drawTexturedModalRect(posX, posY, 0, 0, 88, 9);
                                         mc.ingameGUI.drawTexturedModalRect(posX + 1, posY + 1, 0, 9, (int)thirst.getThirst(), 7);
                                     }
                                 }
                             }  
                          }
                          
                          

                          Les problèmes sont les suivants :

                          • quand la variable thirst arrive à 0 (vérifié à l’aide d’un System.out.println("thirst = "+thirst.getThrist())), normalement je suis censé prendre des dégâts, or il ne se passe rien même si la ligne est présente.
                          • quand je me déco-reco ou que j’étais sur un monde puis que je ferme le jeu et que je reviens. La variable thrist reste bien la même quelle était avant la deconnection (vérifié grâce au System.out.println(…)), pourtant en jeu, le rendu graphique de la barre de soif est total : graphiquemment la barre est pleine alors que ce n’est pas le cas dans la console.
                            Merci par avance pour votre aide.
                          1 réponse Dernière réponse Répondre Citer 0
                          • Alexandre1156A Hors-ligne
                            Alexandre1156
                            dernière édition par

                            @‘elx9000’:

                            • quand la variable thirst arrive à 0 (vérifié à l’aide d’un System.out.println("thirst = "+thirst.getThrist())), normalement je suis censé prendre des dégâts, or il ne se passe rien même si la ligne est présente.
                            • quand je me déco-reco ou que j’étais sur un monde puis que je ferme le jeu et que je reviens. La variable thrist reste bien la même quelle était avant la deconnection (vérifié grâce au System.out.println(…)), pourtant en jeu, le rendu graphique de la barre de soif est total : graphiquemment la barre est pleine alors que ce n’est pas le cas dans la console.
                              Merci par avance pour votre aide.

                            Problème 1 :
                            -La variable *i *est augmenté côté Client et Serveur. Or, non seulement i augmente 2x plus vite (800 / 40ticks = 20s, or ici : 800 / 80ticks = 10s), mais en plus c’est à chaque fois le côté Client qui va atteindre 800 et donc descendre thirst de 1 alors que côté Server, thirst reste à 85. Les dégâts se faisant côté Server, il ne se passe rien car t’a condition est vrai côté Client mais faux côté Server. La solution est de tout faire côté Server (grâce à event.side.server) et lorsque thirst diminue, le faire descendre aussi côté Client via les packets.
                            Problème 2 :
                            -Les capabilities ne sont sauvegardé que côté serveur, or RenderGameOverlayEvent est côté client, il faut donc les syncer en utilisant les packets lorsque le joueur rejoint un monde[size=small.]

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

                              Je suis désolé mais je ne comprends pas ce que c’est que les packets et comment on les utilises. Merci d’avance.

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

                                Il suffit de chercher, surtout qu’il y a un tuto sur le forum.

                                Si je vous ai aidé, n'oubliez pas d’être heureux, j'aiderai encore +

                                AymericRed, moddeur expérimenté qui aide sur ce forum et qui peut accepter de faire un mod Forge rémunéré de temps en temps.

                                Mes tutos : Table de craft, plugin NEI, plugin JEI, modifier l'overlay
                                Je suis un membre apprécié et joueur, j'ai déjà obtenu 6 points de réputation.

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

                                  Désolé, je n’avais pas regardé 😉 . J’ai compris l’idée des packets, par contre je voudrais savoir pour mon problème n°1 où faut-il que je mette event.side.server.

                                  Merci d’avance.

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

                                    Alors si tu mets ça ça permettra que le code à l’intérieur d’un if event.side.isServer() ne soit appelé que si tes sur le serveur, sinon tu peux utiliser un évent tel que ServerTickEvent.

                                    Si je vous ai aidé, n'oubliez pas d’être heureux, j'aiderai encore +

                                    AymericRed, moddeur expérimenté qui aide sur ce forum et qui peut accepter de faire un mod Forge rémunéré de temps en temps.

                                    Mes tutos : Table de craft, plugin NEI, plugin JEI, modifier l'overlay
                                    Je suis un membre apprécié et joueur, j'ai déjà obtenu 6 points de réputation.

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

                                      Je viens d’essayer avec les packets mais ça crash. Je m’y suis peut-être mal pris 😕 . J’ai fait ça :

                                      La classe principale (ModSurvivant):

                                      
                                      package com.survivant.mod;
                                      
                                      import java.awt.Color;
                                      
                                      import com.jcraft.jogg.Packet;
                                      import com.survivant.mod.Capabilities.CapabilityHandler;
                                      import com.survivant.mod.Packet.Message;
                                      import com.survivant.mod.blocks.BlockMod;
                                      import com.survivant.mod.blocks.BlockPotableWater;
                                      import com.survivant.mod.blocks.PotableWater;
                                      import com.survivant.mod.entity.EntityFish;
                                      import com.survivant.mod.entity.EntityRay;
                                      import com.survivant.mod.entity.EntitySalmon;
                                      import com.survivant.mod.handlers.EntityHandler;
                                      import com.survivant.mod.items.ItemMod;
                                      import com.survivant.mod.proxy.CommonProxy;
                                      
                                      import net.minecraft.block.Block;
                                      import net.minecraft.block.state.IBlockState;
                                      import net.minecraft.client.renderer.ItemMeshDefinition;
                                      import net.minecraft.client.renderer.block.statemap.StateMapperBase;
                                      import net.minecraft.client.resources.model.ModelBakery;
                                      import net.minecraft.client.resources.model.ModelResourceLocation;
                                      import net.minecraft.creativetab.CreativeTabs;
                                      import net.minecraft.init.Items;
                                      import net.minecraft.item.Item;
                                      import net.minecraft.item.ItemStack;
                                      import net.minecraft.util.DamageSource;
                                      import net.minecraft.util.ResourceLocation;
                                      import net.minecraftforge.client.model.ModelLoader;
                                      import net.minecraftforge.common.MinecraftForge;
                                      import net.minecraftforge.common.capabilities.Capability;
                                      import net.minecraftforge.common.capabilities.CapabilityInject;
                                      import net.minecraftforge.event.entity.living.LivingEvent;
                                      import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent;
                                      import net.minecraftforge.fluids.BlockFluidClassic;
                                      import net.minecraftforge.fluids.Fluid;
                                      import net.minecraftforge.fluids.FluidContainerRegistry;
                                      import net.minecraftforge.fluids.FluidRegistry;
                                      import net.minecraftforge.fluids.FluidStack;
                                      import net.minecraftforge.fml.common.FMLCommonHandler;
                                      import net.minecraftforge.fml.common.Mod;
                                      import net.minecraftforge.fml.common.Mod.EventHandler;
                                      import net.minecraftforge.fml.common.Mod.Instance;
                                      import net.minecraftforge.fml.common.SidedProxy;
                                      import net.minecraftforge.fml.common.event.FMLInitializationEvent;
                                      import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
                                      import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
                                      import net.minecraftforge.fml.common.network.NetworkRegistry;
                                      import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
                                      import net.minecraftforge.fml.common.registry.GameRegistry;
                                      import net.minecraftforge.fml.relauncher.Side;
                                      import net.minecraftforge.fml.relauncher.SideOnly;
                                      
                                      @Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION)
                                      
                                      public class ModSurvivant
                                      {
                                      
                                         public static SimpleNetworkWrapper network;
                                      
                                         @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
                                         public static CommonProxy proxy;
                                      
                                         @Instance(Reference.MOD_ID)
                                         public static ModSurvivant instance;
                                      
                                         public static CreativeTabs tabSurvivant = new CreativeTabs("tabSurvivant")
                                         {
                                             @SideOnly(Side.CLIENT)
                                             public Item getTabIconItem()
                                             {
                                                 return Item.getItemFromBlock(BlockMod.blockTotem);
                                             }
                                         };
                                      
                                         public static PotableWater potable_water = new PotableWater();
                                         public static BlockPotableWater blockPotableWater;
                                      
                                         public static DamageSource damageSourceDehydration;
                                      
                                         @EventHandler
                                         public void preInit (FMLPreInitializationEvent event)
                                         {    
                                             RemoveRecipes.init();
                                             damageSourceDehydration = new DamageSource("damageSourceDehydration").setDamageBypassesArmor();
                                             ItemMod.init();
                                             ItemMod.register();
                                             BlockMod.init();
                                             BlockMod.register();  
                                      
                                             /*Eau potable*/
                                             FluidRegistry.registerFluid(potable_water);
                                             blockPotableWater = new BlockPotableWater(potable_water);
                                             GameRegistry.registerBlock(blockPotableWater, "blockPotableWater");
                                      
                                             Item item = Item.getItemFromBlock(blockPotableWater);
                                             ModelBakery.registerItemVariants(item);
                                             final ModelResourceLocation loc = new ModelResourceLocation("survivant:potable");
                                             ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition()
                                             {
                                                 @Override
                                                 public ModelResourceLocation getModelLocation(ItemStack stack)
                                                 {
                                                     return loc;
                                                 }
                                             });
                                             ModelLoader.setCustomStateMapper(blockPotableWater, new StateMapperBase()
                                             {
                                                 @Override
                                                 protected ModelResourceLocation getModelResourceLocation(IBlockState state)
                                                 {
                                                     return loc;
                                                 }
                                             });
                                      
                                             network = NetworkRegistry.INSTANCE.newSimpleChannel("MyChannel");
                                             network.registerMessage(Message.Handler.class, Message.class, 0, Side.CLIENT);
                                         }
                                      
                                         @EventHandler
                                         public void init (FMLInitializationEvent event)
                                         {        
                                             proxy.registerRenders();
                                             proxy.init(event);
                                             MinecraftForge.EVENT_BUS.register(new SurvivantBlockEvent());      
                                             MinecraftForge.EVENT_BUS.register(new SurvivantThirstBar());
                                             EntityHandler.RegisterFish(EntityFish.class, "Fish");
                                             EntityHandler.RegisterSalmon(EntitySalmon.class, "Salmon");
                                             EntityHandler.RegisterRay(EntityRay.class, "Ray");
                                         }
                                      
                                         @EventHandler
                                         public void postInit (FMLPostInitializationEvent event)
                                         {
                                      
                                         }
                                      }
                                      
                                      ``` 
                                      
                                      La classe Message (pour le packet):
                                      ```java
                                      
                                      package com.survivant.mod.Packet;
                                      
                                      import io.netty.buffer.ByteBuf;
                                      import net.minecraftforge.fml.common.network.ByteBufUtils;
                                      import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
                                      import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
                                      import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
                                      
                                      public class Message implements IMessage
                                      {
                                         private float thirstVal;
                                      
                                         public Message()
                                         {
                                      
                                         }
                                      
                                         public Message(float val)
                                         {
                                             this.thirstVal = val;
                                         }
                                      
                                         @Override
                                         public void fromBytes(ByteBuf buf)
                                         {
                                             thirstVal = ByteBufUtils.readVarShort(buf);
                                         }
                                      
                                         @Override
                                         public void toBytes(ByteBuf buf)
                                         {
                                             ByteBufUtils.writeVarShort(buf, (int)thirstVal);
                                         }
                                      
                                         public static class Handler implements IMessageHandler <message, imessage="">{
                                      
                                             @Override
                                             public IMessage onMessage(Message message, MessageContext ctx)
                                             {
                                                 return null;
                                             }
                                      
                                         }
                                      }
                                      
                                      

                                      La classe SurvivantThirstBar :

                                      
                                      package com.survivant.mod;
                                      
                                      import com.survivant.mod.Capabilities.IThirst;
                                      import com.survivant.mod.Capabilities.ThirstProvider;
                                      import com.survivant.mod.Packet.Message;
                                      
                                      import net.minecraft.client.Minecraft;
                                      import net.minecraft.entity.player.EntityPlayer;
                                      import net.minecraft.entity.player.EntityPlayerMP;
                                      import net.minecraft.potion.Potion;
                                      import net.minecraft.potion.PotionEffect;
                                      import net.minecraft.util.ChatComponentText;
                                      import net.minecraft.util.DamageSource;
                                      import net.minecraft.util.ResourceLocation;
                                      import net.minecraftforge.client.event.GuiScreenEvent;
                                      import net.minecraftforge.client.event.RenderGameOverlayEvent;
                                      import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
                                      import net.minecraftforge.event.AttachCapabilitiesEvent;
                                      import net.minecraftforge.event.entity.player.PlayerEvent;
                                      import net.minecraftforge.event.entity.player.PlayerSleepInBedEvent;
                                      import net.minecraftforge.fml.common.eventhandler.Event;
                                      import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
                                      import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
                                      import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent;
                                      import net.minecraftforge.fml.common.gameevent.TickEvent;
                                      import net.minecraftforge.fml.relauncher.Side;
                                      import net.minecraftforge.fml.relauncher.SideOnly;
                                      
                                      public class SurvivantThirstBar
                                      {
                                         public static int i = 0;
                                      
                                         @SubscribeEvent
                                         public void onPlayerLogsIn(PlayerLoggedInEvent event)
                                         {
                                             EntityPlayer player = event.player;
                                             IThirst thirst = player.getCapability(ThirstProvider.THIRST_CAP, null);
                                             thirst = (IThirst)ModSurvivant.network.getPacketFrom(new Message(thirst.getThirst()));
                                         }
                                      
                                         @SubscribeEvent
                                         public void onPlayerSleep(PlayerSleepInBedEvent event)
                                         {
                                             EntityPlayer player = event.entityPlayer;
                                             if (player.worldObj.isRemote)
                                             {
                                                 return;
                                             }
                                             IThirst thirst = player.getCapability(ThirstProvider.THIRST_CAP, null);
                                         }
                                      
                                         @SubscribeEvent
                                         public void onPlayerClone(PlayerEvent.Clone event)
                                         {
                                             EntityPlayer player = event.entityPlayer;
                                             IThirst thirst = player.getCapability(ThirstProvider.THIRST_CAP, null);
                                             thirst.set(86);
                                         }
                                      
                                         @SubscribeEvent
                                         public void playerTick(TickEvent.ServerTickEvent event)
                                         {            
                                             EntityPlayer player = Minecraft.getMinecraft().thePlayer;
                                             IThirst thirst = player.getCapability(ThirstProvider.THIRST_CAP, null);
                                             if (!player.capabilities.isCreativeMode)
                                             {
                                                 i++;
                                                 if (i == 800)
                                                 {
                                                     thirst.consume(1);
                                                     ModSurvivant.network.sendTo(new Message(thirst.getThirst()), (EntityPlayerMP)player);
                                                     System.out.println("thirst = " + thirst.getThirst());
                                                     i = 0;
                                                 }
                                                 if (thirst.getThirst() == 0)
                                                 {
                                                     player.attackEntityFrom(ModSurvivant.damageSourceDehydration, 1.0F);
                                                 }
                                             }
                                         }
                                      
                                         @SubscribeEvent
                                         public void onRenderGameOverlay(RenderGameOverlayEvent event)
                                         {
                                             if (!event.isCancelable() && event.type == ElementType.EXPERIENCE)
                                             {
                                                 Minecraft mc = Minecraft.getMinecraft();
                                      
                                                 if (!mc.thePlayer.capabilities.isCreativeMode)
                                                 {
                                                     EntityPlayer player = mc.thePlayer;
                                                     IThirst thirst = player.getCapability(ThirstProvider.THIRST_CAP, null);
                                      
                                                     int posX = event.resolution.getScaledWidth() / 2 + 7;
                                                     int posY = event.resolution.getScaledHeight() - 50;
                                      
                                                     mc.renderEngine.bindTexture(new ResourceLocation("survivant:textures/gui/thirstBar.png"));
                                                     mc.ingameGUI.drawTexturedModalRect(posX, posY, 0, 0, 88, 9);
                                                     mc.ingameGUI.drawTexturedModalRect(posX + 1, posY + 1, 0, 9, (int)thirst.getThirst(), 7);
                                                 }
                                             }
                                         }
                                      
                                      }
                                      
                                      

                                      Merci d’avance pour votre aide.</message,>

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

                                        Alors déjà, da

                                        Si je vous ai aidé, n'oubliez pas d’être heureux, j'aiderai encore +

                                        AymericRed, moddeur expérimenté qui aide sur ce forum et qui peut accepter de faire un mod Forge rémunéré de temps en temps.

                                        Mes tutos : Table de craft, plugin NEI, plugin JEI, modifier l'overlay
                                        Je suis un membre apprécié et joueur, j'ai déjà obtenu 6 points de réputation.

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

                                          Alors déjà dans le “onMessage” de ton packet, tu ne fais rien, donc le packet devient inutile, il faut que tu affectes la valeur de soif du packet à ta capability.
                                          Ensuite, pourrait-on avoir le plus important, le rapport de crash ?

                                          Si je vous ai aidé, n'oubliez pas d’être heureux, j'aiderai encore +

                                          AymericRed, moddeur expérimenté qui aide sur ce forum et qui peut accepter de faire un mod Forge rémunéré de temps en temps.

                                          Mes tutos : Table de craft, plugin NEI, plugin JEI, modifier l'overlay
                                          Je suis un membre apprécié et joueur, j'ai déjà obtenu 6 points de réputation.

                                          1 réponse Dernière réponse Répondre Citer 1
                                          • E Hors-ligne
                                            elx9000
                                            dernière édition par

                                            J’ai mis ceci :

                                            
                                            @Override
                                             public IMessage onMessage(Message message, MessageContext ctx)
                                             {
                                                  EntityPlayer player = Minecraft.getMinecraft().thePlayer;
                                                  IThirst thirst = player.getCapability(ThirstProvider.THIRST_CAP, null);
                                                  thirst.set(thirstVal);
                                                  return null;
                                             }
                                            
                                            

                                            Et voici pour le crash report :

                                            2017-06-04 14:30:18,876 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
                                            2017-06-04 14:30:18,882 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
                                            [14:30:19] [main/INFO] [GradleStart]: Extra: []
                                            [14:30:19] [main/INFO] [GradleStart]: Running with arguments: [–userProperties, {}, --assetsDir, C:/Users/user/.gradle/caches/minecraft/assets, --assetIndex, 1.8, --accessToken{REDACTED}, --version, 1.8.9, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
                                            [14:30:19] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
                                            [14:30:19] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
                                            [14:30:19] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
                                            [14:30:19] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
                                            [14:30:19] [main/INFO] [FML]: Forge Mod Loader version 11.15.1.1747 for Minecraft 1.8.9 loading
                                            [14:30:19] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_121, running on Windows 8.1:amd64:6.3, installed at C:\Program Files\Java\jre1.8.0_121
                                            [14:30:19] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
                                            [14:30:19] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
                                            [14:30:19] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
                                            [14:30:19] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
                                            [14:30:19] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
                                            [14:30:19] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
                                            [14:30:19] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
                                            [14:30:19] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
                                            [14:30:19] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
                                            [14:30:19] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
                                            [14:30:19] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
                                            [14:30:21] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
                                            [14:30:21] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
                                            [14:30:21] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
                                            [14:30:23] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
                                            [14:30:23] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
                                            [14:30:23] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
                                            [14:30:23] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
                                            2017-06-04 14:30:24,317 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
                                            2017-06-04 14:30:24,391 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
                                            2017-06-04 14:30:24,394 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
                                            [14:30:24] [Client thread/INFO]: Setting user: Player943
                                            [14:30:31] [Client thread/INFO]: LWJGL Version: 2.9.4
                                            [14:30:33] [Client thread/WARN] [FML]: =============================================================
                                            [14:30:33] [Client thread/WARN] [FML]: MOD HAS DIRECT REFERENCE System.exit() THIS IS NOT ALLOWED REROUTING TO FML!
                                            [14:30:33] [Client thread/WARN] [FML]: Offendor: com/sun/jna/Native.main([Ljava/lang/String;)V
                                            [14:30:33] [Client thread/WARN] [FML]: Use FMLCommonHandler.exitJava instead
                                            [14:30:33] [Client thread/WARN] [FML]: =============================================================
                                            [14:30:34] [Client thread/INFO] [STDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:246]: –-- Minecraft Crash Report ----
                                            // Quite honestly, I wouldn't worry myself about that.
                                            
                                            Time: 04/06/17 14:30
                                            Description: Loading screen debug info
                                            
                                            This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR
                                            
                                            A detailed walkthrough of the error, its code path and all known details is as follows:
                                            ---------------------------------------------------------------------------------------
                                            
                                            -- System Details --
                                            Details:
                                            Minecraft Version: 1.8.9
                                            Operating System: Windows 8.1 (amd64) version 6.3
                                            Java Version: 1.8.0_121, Oracle Corporation
                                            Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
                                            Memory: 787543920 bytes (751 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
                                            JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
                                            IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
                                            FML:
                                            Loaded coremods (and transformers):
                                            GL info: ' Vendor: 'Intel' Version: '4.0.0 - Build 10.18.10.3621' Renderer: 'Intel(R) HD Graphics 4000'
                                            [14:30:34] [Client thread/INFO] [FML]: MinecraftForge v11.15.1.1747 Initialized
                                            [14:30:34] [Client thread/INFO] [FML]: Replaced 204 ore recipies
                                            [14:30:35] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
                                            [14:30:35] [Client thread/INFO] [FML]: Searching C:\Users\user\Desktop\forge-1.8.9-11.15.1.1747-mdk\run\mods for mods
                                            [14:30:38] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load
                                            [14:30:38] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, survivant] at CLIENT
                                            [14:30:38] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, survivant] at SERVER
                                            [14:30:40] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Mod Survivant
                                            [14:30:40] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
                                            [14:30:40] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations
                                            [14:30:40] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
                                            [14:30:40] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
                                            [14:30:40] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
                                            [14:30:40] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
                                            [14:30:40] [Client thread/INFO] [FML]: Applying holder lookups
                                            [14:30:40] [Client thread/INFO] [FML]: Holder lookups applied
                                            [14:30:40] [Client thread/INFO] [FML]: Injecting itemstacks
                                            [14:30:40] [Client thread/INFO] [FML]: Itemstack injection complete
                                            [14:30:41] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Found status: OUTDATED Target: 11.15.1.1902
                                            [14:30:41] [Sound Library Loader/INFO]: Starting up SoundSystem…
                                            [14:30:41] [Thread-9/INFO]: Initializing LWJGL OpenAL
                                            [14:30:41] [Thread-9/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
                                            [14:30:42] [Thread-9/INFO]: OpenAL initialized.
                                            [14:30:42] [Sound Library Loader/INFO]: Sound engine started
                                            [14:30:56] [Client thread/INFO] [FML]: Max texture size: 8192
                                            [14:30:56] [Client thread/INFO]: Created: 16x16 textures-atlas
                                            [14:30:57] [Client thread/ERROR] [FML]: Model definition for location survivant:blockBanana#inventory not found
                                            [14:30:57] [Client thread/ERROR] [FML]: Model definition for location survivant:blockCoconut#inventory not found
                                            [14:30:58] [Client thread/INFO] [FML]: Injecting itemstacks
                                            [14:30:58] [Client thread/INFO] [FML]: Itemstack injection complete
                                            [14:30:59] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods
                                            [14:30:59] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Mod Survivant
                                            [14:30:59] [Client thread/INFO]: SoundSystem shutting down…
                                            [14:30:59] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
                                            [14:30:59] [Sound Library Loader/INFO]: Starting up SoundSystem…
                                            [14:30:59] [Thread-11/INFO]: Initializing LWJGL OpenAL
                                            [14:30:59] [Thread-11/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
                                            [14:30:59] [Thread-11/INFO]: OpenAL initialized.
                                            [14:30:59] [Sound Library Loader/INFO]: Sound engine started
                                            [14:31:09] [Client thread/INFO] [FML]: Max texture size: 8192
                                            [14:31:11] [Client thread/INFO]: Created: 512x512 textures-atlas
                                            [14:31:11] [Client thread/ERROR] [FML]: Model definition for location survivant:blockBanana#inventory not found
                                            [14:31:11] [Client thread/ERROR] [FML]: Model definition for location survivant:blockCoconut#inventory not found
                                            [14:31:19] [Server thread/INFO]: Starting integrated minecraft server version 1.8.9
                                            [14:31:19] [Server thread/INFO]: Generating keypair
                                            [14:31:19] [Server thread/INFO] [FML]: Injecting existing block and item data into this server instance
                                            [14:31:19] [Server thread/INFO] [FML]: Found a missing id from the world survivant:blockCampfire
                                            [14:31:19] [Server thread/INFO] [FML]: Found a missing id from the world survivant:block_potable_water
                                            [14:31:19] [Server thread/INFO] [FML]: Found a missing id from the world survivant:blockManioc
                                            [14:31:19] [Server thread/INFO] [FML]: Found a missing id from the world survivant:block2
                                            [14:31:19] [Server thread/INFO] [FML]: Found a missing id from the world survivant:blockSurvivalBed
                                            [14:31:19] [Server thread/INFO] [FML]: Found a missing id from the world survivant:blockSaltWater
                                            [14:31:19] [Server thread/INFO] [FML]: Applying holder lookups
                                            [14:31:19] [Server thread/INFO] [FML]: Holder lookups applied
                                            [14:31:19] [Server thread/INFO] [FML]: Loading dimension 0 (Mod survivant) (net.minecraft.server.integrated.IntegratedServer@41db268d)
                                            [14:31:19] [Server thread/INFO] [FML]: Loading dimension 1 (Mod survivant) (net.minecraft.server.integrated.IntegratedServer@41db268d)
                                            [14:31:19] [Server thread/INFO] [FML]: Loading dimension -1 (Mod survivant) (net.minecraft.server.integrated.IntegratedServer@41db268d)
                                            [14:31:19] [Server thread/INFO]: Preparing start region for level 0
                                            [14:31:21] [Server thread/INFO]: Preparing spawn area: 42%
                                            [14:31:21] [Server thread/ERROR] [FML]: Exception caught during firing event net.minecraftforge.fml.common.gameevent.TickEvent$ServerTickEvent@29adea34:
                                            java.lang.NullPointerException
                                            at com.survivant.mod.SurvivantThirstBar.playerTick(SurvivantThirstBar.java:64) ~[SurvivantThirstBar.class:?]
                                            at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_12_SurvivantThirstBar_playerTick_ServerTickEvent.invoke(.dynamic) ~[?:?]
                                            at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:49) ~[ASMEventHandler.class:?]
                                            at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140) [EventBus.class:?]
                                            at net.minecraftforge.fml.common.FMLCommonHandler.onPreServerTick(FMLCommonHandler.java:266) [FMLCommonHandler.class:?]
                                            at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:670) [MinecraftServer.class:?]
                                            at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:159) [IntegratedServer.class:?]
                                            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:548) [MinecraftServer.class:?]
                                            at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]
                                            [14:31:21] [Server thread/ERROR] [FML]: Index: 1 Listeners:
                                            [14:31:21] [Server thread/ERROR] [FML]: 0: NORMAL
                                            [14:31:21] [Server thread/ERROR] [FML]: 1: ASM: com.survivant.mod.SurvivantThirstBar@2149532d playerTick(Lnet/minecraftforge/fml/common/gameevent/TickEvent$ServerTickEvent;)V
                                            [14:31:21] [Server thread/ERROR]: Encountered an unexpected exception
                                            java.lang.NullPointerException
                                            at com.survivant.mod.SurvivantThirstBar.playerTick(SurvivantThirstBar.java:64) ~[SurvivantThirstBar.class:?]
                                            at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_12_SurvivantThirstBar_playerTick_ServerTickEvent.invoke(.dynamic) ~[?:?]
                                            at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:49) ~[ASMEventHandler.class:?]
                                            at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140) ~[EventBus.class:?]
                                            at net.minecraftforge.fml.common.FMLCommonHandler.onPreServerTick(FMLCommonHandler.java:266) ~[FMLCommonHandler.class:?]
                                            at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:670) ~[MinecraftServer.class:?]
                                            at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:159) ~[IntegratedServer.class:?]
                                            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:548) [MinecraftServer.class:?]
                                            at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]
                                            [14:31:21] [Server thread/ERROR]: This crash report has been saved to: C:\Users\user\Desktop\forge-1.8.9-11.15.1.1747-mdk\run\.\crash-reports\crash-2017-06-04_14.31.21-server.txt
                                            [14:31:21] [Server thread/INFO]: Stopping server
                                            [14:31:21] [Server thread/INFO]: Saving players
                                            [14:31:21] [Server thread/INFO]: Saving worlds
                                            [14:31:21] [Server thread/INFO]: Saving chunks for level 'Mod survivant'/Overworld
                                            [14:31:21] [Server thread/INFO]: Saving chunks for level 'Mod survivant'/Nether
                                            [14:31:21] [Server thread/INFO]: Saving chunks for level 'Mod survivant'/The End
                                            [14:31:21] [Server thread/INFO] [FML]: Unloading dimension 0
                                            [14:31:21] [Server thread/INFO] [FML]: Unloading dimension -1
                                            [14:31:21] [Server thread/INFO] [FML]: Unloading dimension 1
                                            [14:31:21] [Server thread/INFO] [FML]: Applying holder lookups
                                            [14:31:21] [Server thread/INFO] [FML]: Holder lookups applied
                                            [14:31:21] [Server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STOPPING and forced into state SERVER_STOPPED. Errors may have been discarded.
                                            [14:31:22] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:612]: –-- Minecraft Crash Report ----
                                            // You're mean.
                                            
                                            Time: 04/06/17 14:31
                                            Description: Exception in server tick loop
                                            
                                            java.lang.NullPointerException: Exception in server tick loop
                                            at com.survivant.mod.SurvivantThirstBar.playerTick(SurvivantThirstBar.java:64)
                                            at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_12_SurvivantThirstBar_playerTick_ServerTickEvent.invoke(.dynamic)
                                            at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:49)
                                            at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140)
                                            at net.minecraftforge.fml.common.FMLCommonHandler.onPreServerTick(FMLCommonHandler.java:266)
                                            at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:670)
                                            at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:159)
                                            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:548)
                                            at java.lang.Thread.run(Unknown Source)
                                            
                                            A detailed walkthrough of the error, its code path and all known details is as follows:
                                            ---------------------------------------------------------------------------------------
                                            
                                            -- System Details --
                                            Details:
                                            Minecraft Version: 1.8.9
                                            Operating System: Windows 8.1 (amd64) version 6.3
                                            Java Version: 1.8.0_121, Oracle Corporation
                                            Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
                                            Memory: 821776008 bytes (783 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
                                            JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
                                            IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
                                            FML: MCP 9.19 Powered by Forge 11.15.1.1747 4 mods loaded, 4 mods active
                                            States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
                                            UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)
                                            UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8.9-11.15.1.1747.jar)
                                            UCHIJAAAA Forge{11.15.1.1747} [Minecraft Forge] (forgeSrc-1.8.9-11.15.1.1747.jar)
                                            UCHIJAAAA survivant{1.0.0} [Mod Survivant] (bin)
                                            Loaded coremods (and transformers):
                                            GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
                                            Profiler Position: N/A (disabled)
                                            Player Count: 0 / 8; []
                                            Type: Integrated Server (map_client.txt)
                                            Is Modded: Definitely; Client brand changed to 'fml,forge'
                                            [14:31:22] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:612]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2017-06-04_14.31.21-server.txt
                                            AL lib: (EE) alc_cleanup: 1 device not closed
                                            Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
                                            
                                            

                                            Merci par avance.

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

                                            MINECRAFT FORGE FRANCE © 2024

                                            Powered by NodeBB