MFF

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

    Uncmlaim finder en 1.12.2

    Planifier Épinglé Verrouillé Déplacé Résolu 1.12.x
    1.12.2
    40 Messages 5 Publieurs 2.2k 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
      Drastic
      dernière édition par

      up ?

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

        C’mon y’en a des dizaines de sujets comme celui ci sur le forum et avec du code en +

        D 2 réponses Dernière réponse Répondre Citer 1
        • D Hors-ligne
          Drastic @Deleted
          dernière édition par

          @Plaigon je sais mais y’en a pas en 1.12.2 qui marche.

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

            @Plaigon voici mon code : quand je lance ca crash (je crois a cause du EnumHand hand)

            package com.avonia.mod.util.handlers;
            
            import com.avonia.mod.init.ItemInit;
            import com.avonia.mod.init.objects.ItemRadar;
            import com.avonia.mod.util.Reference;
            
            import net.minecraft.block.BlockDoublePlant.EnumPlantType;
            import net.minecraft.client.Minecraft;
            import net.minecraft.client.gui.FontRenderer;
            import net.minecraft.client.gui.Gui;
            import net.minecraft.entity.player.EntityPlayer;
            import net.minecraft.item.ItemStack;
            import net.minecraft.util.EnumHand;
            import net.minecraft.util.ResourceLocation;
            import net.minecraftforge.client.event.RenderGameOverlayEvent;
            import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
            import net.minecraftforge.fml.relauncher.Side;
            import net.minecraftforge.fml.relauncher.SideOnly;
            
            public class RadarHandler extends Gui
            {
                private Minecraft mc;
                
                private String show;
                
                private EnumHand hand;
                
                FontRenderer fontRender;
                
                final ResourceLocation bg = new ResourceLocation(Reference.MODID + ":textures/items/radar.png");
            
                public RadarHandler() {
                    this.mc = Minecraft.getMinecraft();
                    this.show = "0%";
                    this.fontRender = this.mc.fontRenderer;
                }
                
                @SideOnly(Side.CLIENT)
                @SubscribeEvent
                public void onRenderPre(RenderGameOverlayEvent.Pre event)
                {
                  
                    if(event.getType() == RenderGameOverlayEvent.ElementType.EXPERIENCE)
                    {
                        if(isHoldingRadar(hand))
                        {
                             mc.getTextureManager().bindTexture(this.bg);
                            
                            drawModalRectWithCustomSizedTexture(5,5,0,0,32,32,32,32);        
                            
                            int amountTiles = this.mc.world.getChunkFromChunkCoords(this.mc.player.chunkCoordX + 0,
                                    this.mc.player.chunkCoordZ + 0).getTileEntityMap().values().size();
                            
                            amountTiles = amountTiles + this.mc.world.getChunkFromChunkCoords(this.mc.player.chunkCoordX + 0,
                                    this.mc.player.chunkCoordZ + 1).getTileEntityMap().values().size();
                            
                            amountTiles = amountTiles + this.mc.world.getChunkFromChunkCoords(this.mc.player.chunkCoordX + 0,
                                    this.mc.player.chunkCoordZ - 1).getTileEntityMap().values().size();
                            
                            amountTiles = amountTiles + this.mc.world.getChunkFromChunkCoords(this.mc.player.chunkCoordX + 1,
                                    this.mc.player.chunkCoordZ).getTileEntityMap().values().size();
                            
                            amountTiles = amountTiles + this.mc.world.getChunkFromChunkCoords(this.mc.player.chunkCoordX - 1,
                                    this.mc.player.chunkCoordZ).getTileEntityMap().values().size();   
                        }
                        
                        event.setCanceled(true);
                    }
                }
                 
                public void drawString(FontRenderer par1FontRenderer, String par2Str, int par3, int par4, int par5)
                {
                    par1FontRenderer.drawStringWithShadow(par2Str, par3, par4, par5);
                }
                
                private static boolean isHoldingRadar(EnumHand hand)
                {       
                    return Minecraft.getMinecraft().player.getHeldItem(hand) == new ItemStack(ItemInit.radar);
                }
            }
            
            
            1 réponse Dernière réponse Répondre Citer 0
            • DeletedD Hors-ligne
              Deleted
              dernière édition par

              Ta variable RadarHandler#hand est null. SI tu veux vérifier la présence de l’item radar dans la main droite alors c’est EnumHand.MAIN_HAND, sinon pour la main gauche c’est EnumHand.OFF_HAND

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

                Ce message a été supprimé !
                1 réponse Dernière réponse Répondre Citer 0
                • D Hors-ligne
                  Drastic
                  dernière édition par

                  @Plaigon … Ca ne crash plus mais ca ne s’affiche pas.

                  public class RadarHandler extends Gui
                  {
                      private Minecraft mc;
                      
                      private String show;
                  
                      
                      FontRenderer fontRender;
                      
                      final ResourceLocation bg = new ResourceLocation(Reference.MODID + ":textures/items/radar.png");
                  
                      public RadarHandler() {
                          this.mc = Minecraft.getMinecraft();
                          this.show = "0%";
                          this.fontRender = this.mc.fontRenderer;
                      }
                      
                      @SideOnly(Side.CLIENT)
                      @SubscribeEvent
                      public void onRenderPre(RenderGameOverlayEvent.Pre event)
                      {
                        
                          if(event.getType() == RenderGameOverlayEvent.ElementType.EXPERIENCE)
                          {
                              if(ItemRadar.isUsed && mc.world.isRemote && mc.player.getHeldItem(EnumHand.MAIN_HAND) == new ItemStack(ItemInit.radar))
                              {
                                   mc.getTextureManager().bindTexture(this.bg);
                                  
                                  drawModalRectWithCustomSizedTexture(5,5,0,0,32,32,32,32);        
                                  
                                  int amountTiles = this.mc.world.getChunkFromChunkCoords(this.mc.player.chunkCoordX + 0,
                                          this.mc.player.chunkCoordZ + 0).getTileEntityMap().values().size();
                                  
                                  amountTiles = amountTiles + this.mc.world.getChunkFromChunkCoords(this.mc.player.chunkCoordX + 0,
                                          this.mc.player.chunkCoordZ + 1).getTileEntityMap().values().size();
                                  
                                  amountTiles = amountTiles + this.mc.world.getChunkFromChunkCoords(this.mc.player.chunkCoordX + 0,
                                          this.mc.player.chunkCoordZ - 1).getTileEntityMap().values().size();
                                  
                                  amountTiles = amountTiles + this.mc.world.getChunkFromChunkCoords(this.mc.player.chunkCoordX + 1,
                                          this.mc.player.chunkCoordZ).getTileEntityMap().values().size();
                                  
                                  amountTiles = amountTiles + this.mc.world.getChunkFromChunkCoords(this.mc.player.chunkCoordX - 1,
                                          this.mc.player.chunkCoordZ).getTileEntityMap().values().size();   
                              }
                              
                              event.setCanceled(true);
                          }
                      }
                       
                      public void drawString(FontRenderer par1FontRenderer, String par2Str, int par3, int par4, int par5)
                      {
                          par1FontRenderer.drawStringWithShadow(par2Str, par3, par4, par5);
                      }
                      
                  }
                  
                  1 réponse Dernière réponse Répondre Citer 0
                  • DeletedD Hors-ligne
                    Deleted
                    dernière édition par Deleted

                    Si tu veux afficher un overlay il faut vérifier le type rendu à l’écran lors de l’event, de mémoire ça devrait être HELMET.
                    Regarde comment la citrouille affiche son overlay, t’auras juste à copy paste pour ton cas à toi.

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

                      @Plaigon avec EXPERIENCE ca allait mais c’est uniquement quand je rajoute la condition avec l’item dans la main que ca ne s’affiche plus. (jai testé avant avec HELMET

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

                        Surement ItemRadar.isUsed qui coince alors. Tu peux debug et voir l’état de tes variables, tu gagneras en efficacité.
                        D’ailleurs pour éviter tout problème de valeur commune, n’utilise pas de variables static dans les classes du type Item, Block, Entity, etc… mais plutôt les NBTTag

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

                          @Plaigon le isUsed pose problème mais même sans ca ne vas pas

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

                            Si tu ne veux pas debug, pose des println et t’auras la réponse.

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

                              @Plaigon bah j’ai fait ca :

                              package com.avonia.mod.util.handlers;
                              
                              import com.avonia.mod.init.ItemInit;
                              import com.avonia.mod.init.objects.ItemRadar;
                              import com.avonia.mod.util.Reference;
                              
                              import net.minecraft.block.BlockDoublePlant.EnumPlantType;
                              import net.minecraft.client.Minecraft;
                              import net.minecraft.client.gui.FontRenderer;
                              import net.minecraft.client.gui.Gui;
                              import net.minecraft.entity.player.EntityPlayer;
                              import net.minecraft.item.ItemStack;
                              import net.minecraft.util.EnumHand;
                              import net.minecraft.util.ResourceLocation;
                              import net.minecraftforge.client.event.RenderGameOverlayEvent;
                              import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
                              import net.minecraftforge.fml.relauncher.Side;
                              import net.minecraftforge.fml.relauncher.SideOnly;
                              
                              public class RadarHandler extends Gui
                              {
                                  private Minecraft mc;
                                  
                                  private String show;
                                  
                                  FontRenderer fontRender;
                                  
                                  final ResourceLocation bg = new ResourceLocation(Reference.MODID + ":textures/items/radar.png");
                              
                                  public RadarHandler() {
                                      this.mc = Minecraft.getMinecraft();
                                      this.show = "0%";
                                      this.fontRender = this.mc.fontRenderer;
                                  }
                                  
                                  @SideOnly(Side.CLIENT)
                                  @SubscribeEvent
                                  public void onRenderPre(RenderGameOverlayEvent.Pre event)
                                  {
                                    
                                      if(event.getType() == RenderGameOverlayEvent.ElementType.HELMET)
                                      {
                                          if(mc.world.isRemote && mc.player.getHeldItem(EnumHand.MAIN_HAND) == new ItemStack(ItemInit.radar))
                                          {
                                               mc.getTextureManager().bindTexture(this.bg);
                                              
                                              drawModalRectWithCustomSizedTexture(5,5,0,0,32,32,32,32);        
                                              
                                              int amountTiles = this.mc.world.getChunkFromChunkCoords(this.mc.player.chunkCoordX + 0,
                                                      this.mc.player.chunkCoordZ + 0).getTileEntityMap().values().size();
                                              
                                              amountTiles = amountTiles + this.mc.world.getChunkFromChunkCoords(this.mc.player.chunkCoordX + 0,
                                                      this.mc.player.chunkCoordZ + 1).getTileEntityMap().values().size();
                                              
                                              amountTiles = amountTiles + this.mc.world.getChunkFromChunkCoords(this.mc.player.chunkCoordX + 0,
                                                      this.mc.player.chunkCoordZ - 1).getTileEntityMap().values().size();
                                              
                                              amountTiles = amountTiles + this.mc.world.getChunkFromChunkCoords(this.mc.player.chunkCoordX + 1,
                                                      this.mc.player.chunkCoordZ).getTileEntityMap().values().size();
                                              
                                              amountTiles = amountTiles + this.mc.world.getChunkFromChunkCoords(this.mc.player.chunkCoordX - 1,
                                                      this.mc.player.chunkCoordZ).getTileEntityMap().values().size();   
                                              
                                              System.out.println("affiché");
                                          }
                                          
                                          event.setCanceled(true);
                                      }
                                  }
                                   
                              }
                              
                              

                              Mais j’ai tjrs rien dans la console.

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

                                En général quand je draw un overlay, j’utilise des attributs OpenGL avant et après, comme le fait l’overlay de la citrouille. De + si ta texture a une résolution de 32*32 tu peux simplement utiliser Gui#drawTexturedModalRect je pense.

                                D 2 réponses Dernière réponse Répondre Citer 0
                                • D Hors-ligne
                                  Drastic @Deleted
                                  dernière édition par

                                  @Plaigon a dit dans Uncmlaim finder en 1.12.2 :

                                  utiliser

                                  J’ai juste modif pour la taille parce que sinon ca dupliquait la texture.

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

                                    @Plaigon mais j’ai un autre prblm : quand j’essaie de dessinner un string, ca crash/

                                    public class RadarHandler extends Gui
                                    {
                                        private Minecraft mc;
                                        
                                        private String show;
                                        
                                        FontRenderer fontRender;
                                        
                                        final ResourceLocation bg = new ResourceLocation(Reference.MODID + ":textures/items/radar.png");
                                    
                                        public RadarHandler() {
                                            this.mc = Minecraft.getMinecraft();
                                            this.show = "0%";
                                            this.fontRender = this.mc.fontRenderer;
                                        }
                                        
                                        @SideOnly(Side.CLIENT)
                                        @SubscribeEvent
                                        public void onRenderPre(RenderGameOverlayEvent.Pre event)
                                        {
                                          
                                            if(event.getType() == RenderGameOverlayEvent.ElementType.HELMET)
                                            {
                                                /*if(mc.world.isRemote && mc.player.getHeldItem(EnumHand.MAIN_HAND) == new ItemStack(ItemInit.radar))
                                                {*/
                                                     mc.getTextureManager().bindTexture(this.bg);
                                                    
                                                    drawModalRectWithCustomSizedTexture(5,5,0,0,32,32,32,32);        
                                                    
                                                    int amountTiles = mc.world.getChunkFromChunkCoords(mc.player.chunkCoordX + 0,
                                                            mc.player.chunkCoordZ + 0).getTileEntityMap().values().size();
                                                    
                                                    amountTiles = amountTiles + mc.world.getChunkFromChunkCoords(mc.player.chunkCoordX + 0,
                                                            mc.player.chunkCoordZ + 1).getTileEntityMap().values().size();
                                                    
                                                    amountTiles = amountTiles + mc.world.getChunkFromChunkCoords(mc.player.chunkCoordX + 0,
                                                            mc.player.chunkCoordZ - 1).getTileEntityMap().values().size();
                                                    
                                                    amountTiles = amountTiles + mc.world.getChunkFromChunkCoords(mc.player.chunkCoordX + 1,
                                                            mc.player.chunkCoordZ).getTileEntityMap().values().size();
                                                    
                                                    amountTiles = amountTiles + mc.world.getChunkFromChunkCoords(mc.player.chunkCoordX - 1,
                                                            mc.player.chunkCoordZ).getTileEntityMap().values().size();   
                                    
                                                    drawCenteredString(fontRender, amountTiles + "%", 0,100, 11);
                                                    System.out.println("affiché");
                                                //}
                                                
                                                event.setCanceled(true);
                                            }
                                        }
                                         
                                    }
                                    

                                    Crash report :

                                    ---- Minecraft Crash Report ----
                                    // Who set us up the TNT?
                                    
                                    Time: 4/13/20 4:10 PM
                                    Description: Unexpected error
                                    
                                    java.lang.NullPointerException: Unexpected error
                                    	at net.minecraft.client.gui.Gui.drawCenteredString(Gui.java:127)
                                    	at com.avonia.mod.util.handlers.RadarHandler.onRenderPre(RadarHandler.java:66)
                                    	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_16_RadarHandler_onRenderPre_Pre.invoke(.dynamic)
                                    	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
                                    	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
                                    	at net.minecraftforge.client.GuiIngameForge.pre(GuiIngameForge.java:910)
                                    	at net.minecraftforge.client.GuiIngameForge.renderHelmet(GuiIngameForge.java:271)
                                    	at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:135)
                                    	at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1151)
                                    	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1209)
                                    	at net.minecraft.client.Minecraft.run(Minecraft.java:442)
                                    	at net.minecraft.client.main.Main.main(Main.java:118)
                                    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                                    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                                    	at java.lang.reflect.Method.invoke(Method.java:498)
                                    	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(NativeMethodAccessorImpl.java:62)
                                    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                                    	at java.lang.reflect.Method.invoke(Method.java:498)
                                    	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
                                    	at GradleStart.main(GradleStart.java:25)
                                    
                                    
                                    A detailed walkthrough of the error, its code path and all known details is as follows:
                                    ---------------------------------------------------------------------------------------
                                    
                                    -- Head --
                                    Thread: Client thread
                                    Stacktrace:
                                    	at net.minecraft.client.gui.Gui.drawCenteredString(Gui.java:127)
                                    	at com.avonia.mod.util.handlers.RadarHandler.onRenderPre(RadarHandler.java:66)
                                    	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_16_RadarHandler_onRenderPre_Pre.invoke(.dynamic)
                                    	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
                                    	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
                                    	at net.minecraftforge.client.GuiIngameForge.pre(GuiIngameForge.java:910)
                                    	at net.minecraftforge.client.GuiIngameForge.renderHelmet(GuiIngameForge.java:271)
                                    	at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:135)
                                    
                                    -- Affected level --
                                    Details:
                                    	Level name: MpServer
                                    	All players: 1 total; [EntityPlayerSP['Player996'/584, l='MpServer', x=8.50, y=65.00, z=8.50]]
                                    	Chunk stats: MultiplayerChunkCache: 0, 0
                                    	Level seed: 0
                                    	Level generator: ID 00 - default, ver 1. Features enabled: false
                                    	Level generator options: 
                                    	Level spawn location: World: (8,64,8), Chunk: (at 8,4,8 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,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: creative (ID 1). Hardcore: false. Cheats: false
                                    	Forced entities: 1 total; [EntityPlayerSP['Player996'/584, 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:461)
                                    	at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2889)
                                    	at net.minecraft.client.Minecraft.run(Minecraft.java:471)
                                    	at net.minecraft.client.main.Main.main(Main.java:118)
                                    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                                    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                                    	at java.lang.reflect.Method.invoke(Method.java:498)
                                    	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(NativeMethodAccessorImpl.java:62)
                                    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                                    	at java.lang.reflect.Method.invoke(Method.java:498)
                                    	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
                                    	at GradleStart.main(GradleStart.java:25)
                                    
                                    -- System Details --
                                    Details:
                                    	Minecraft Version: 1.12.2
                                    	Operating System: Windows 10 (amd64) version 10.0
                                    	Java Version: 1.8.0_181, Oracle Corporation
                                    	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
                                    	Memory: 667795368 bytes (636 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
                                    	JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
                                    	IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
                                    	FML: MCP 9.42 Powered by Forge 14.23.5.2847 5 mods loaded, 5 mods active
                                    	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
                                    
                                    	| State  | ID        | Version      | Source                           | Signature |
                                    	|:------ |:--------- |:------------ |:-------------------------------- |:--------- |
                                    	| LCHIJA | minecraft | 1.12.2       | minecraft.jar                    | None      |
                                    	| LCHIJA | mcp       | 9.42         | minecraft.jar                    | None      |
                                    	| LCHIJA | FML       | 8.0.99.99    | forgeSrc-1.12.2-14.23.5.2847.jar | None      |
                                    	| LCHIJA | forge     | 14.23.5.2847 | forgeSrc-1.12.2-14.23.5.2847.jar | None      |
                                    	| LCHIJA | avonia    | 1.0.0        | bin                              | None      |
                                    
                                    	Loaded coremods (and transformers): 
                                    	GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 445.75' Renderer: 'GeForce GTX 1050/PCIe/SSE2'
                                    	Launched Version: 1.12.2
                                    	LWJGL: 2.9.4
                                    	OpenGL: GeForce GTX 1050/PCIe/SSE2 GL version 4.6.0 NVIDIA 445.75, NVIDIA Corporation
                                    	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: Yes
                                    	Is Modded: Definitely; Client brand changed to 'fml,forge'
                                    	Type: Client (map_client.txt)
                                    	Resource Packs: 
                                    	Current Language: English (US)
                                    	Profiler Position: N/A (disabled)
                                    	CPU: 16x AMD Ryzen 7 1700 Eight-Core Processor ```
                                    1 réponse Dernière réponse Répondre Citer 0
                                    • DeletedD Hors-ligne
                                      Deleted
                                      dernière édition par

                                      Youtube Video

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

                                        Il faut que tu vérifie que event.getType() != null et si ça marche pas envoie ton code avec les imports car sinon les lignes ne sont pas juste avec le crash report

                                        Mes créations :

                                        Mod en cours de développement : Personal Robot (1.15.2)

                                        Datapacks : DailyCraft's Craft (beta)

                                        Je suis un membre apprécié et joueur, j'ai déjà obtenu 2 point(s) de réputation.

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

                                          @DailyCraft merci de ta réponse.
                                          Ca ne marche toujours pas…
                                          Le crash report me donne un NullPointerException 😕

                                          Code :

                                          package com.avonia.mod.util.handlers;
                                          
                                          import org.jline.utils.PumpReader;
                                          
                                          import com.avonia.mod.init.ItemInit;
                                          import com.avonia.mod.init.objects.ItemRadar;
                                          import com.avonia.mod.util.Reference;
                                          
                                          import net.minecraft.block.BlockDoublePlant.EnumPlantType;
                                          import net.minecraft.client.Minecraft;
                                          import net.minecraft.client.gui.FontRenderer;
                                          import net.minecraft.client.gui.Gui;
                                          import net.minecraft.entity.player.EntityPlayer;
                                          import net.minecraft.item.ItemStack;
                                          import net.minecraft.util.EnumHand;
                                          import net.minecraft.util.ResourceLocation;
                                          import net.minecraftforge.client.event.RenderGameOverlayEvent;
                                          import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
                                          import net.minecraftforge.fml.relauncher.Side;
                                          import net.minecraftforge.fml.relauncher.SideOnly;
                                          
                                          public class RadarHandler extends Gui
                                          {
                                              private Minecraft mc;
                                              
                                              public static int amountTiles;
                                              
                                              
                                              FontRenderer fontRender;
                                              
                                              final ResourceLocation bg = new ResourceLocation(Reference.MODID + ":textures/items/radar.png");
                                          
                                              public RadarHandler() {
                                                  this.mc = Minecraft.getMinecraft();
                                                  this.fontRender = this.mc.fontRenderer;
                                              }
                                              
                                              @SideOnly(Side.CLIENT)
                                              @SubscribeEvent
                                              public void onRenderPre(RenderGameOverlayEvent.Pre event)
                                              {
                                                
                                                  if(event.getType() != null)
                                                  {
                                                       mc.getTextureManager().bindTexture(this.bg);
                                                          
                                                          drawModalRectWithCustomSizedTexture(5,5,0,0,32,32,32,32);        
                                                          
                                                          amountTiles = mc.world.getChunkFromChunkCoords(mc.player.chunkCoordX + 0,
                                                                  mc.player.chunkCoordZ + 0).getTileEntityMap().values().size();
                                                          
                                                          amountTiles = amountTiles + mc.world.getChunkFromChunkCoords(mc.player.chunkCoordX + 0,
                                                                  mc.player.chunkCoordZ + 1).getTileEntityMap().values().size();
                                                          
                                                          amountTiles = amountTiles + mc.world.getChunkFromChunkCoords(mc.player.chunkCoordX + 0,
                                                                  mc.player.chunkCoordZ - 1).getTileEntityMap().values().size();
                                                          
                                                          amountTiles = amountTiles + mc.world.getChunkFromChunkCoords(mc.player.chunkCoordX + 1,
                                                                  mc.player.chunkCoordZ).getTileEntityMap().values().size();
                                                          
                                                          amountTiles = amountTiles + mc.world.getChunkFromChunkCoords(mc.player.chunkCoordX - 1,
                                                                  mc.player.chunkCoordZ).getTileEntityMap().values().size();   
                                          
                                                          drawCenteredString(fontRender, this.amountTiles + "%", 0,100, 11);
                                          
                                                      event.setCanceled(true);
                                                  }
                                              }
                                               
                                          }
                                          
                                          

                                          Crash-report:

                                          ---- Minecraft Crash Report ----
                                          // This doesn't make any sense!
                                          
                                          Time: 4/14/20 4:28 PM
                                          Description: Unexpected error
                                          
                                          java.lang.NullPointerException: Unexpected error
                                          	at net.minecraft.client.gui.Gui.drawCenteredString(Gui.java:127)
                                          	at com.avonia.mod.util.handlers.RadarHandler.onRenderPre(RadarHandler.java:64)
                                          	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_16_RadarHandler_onRenderPre_Pre.invoke(.dynamic)
                                          	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
                                          	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
                                          	at net.minecraftforge.client.GuiIngameForge.pre(GuiIngameForge.java:910)
                                          	at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:119)
                                          	at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1151)
                                          	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1209)
                                          	at net.minecraft.client.Minecraft.run(Minecraft.java:442)
                                          	at net.minecraft.client.main.Main.main(Main.java:118)
                                          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                          	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                                          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                                          	at java.lang.reflect.Method.invoke(Method.java:498)
                                          	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(NativeMethodAccessorImpl.java:62)
                                          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                                          	at java.lang.reflect.Method.invoke(Method.java:498)
                                          	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
                                          	at GradleStart.main(GradleStart.java:25)
                                          
                                          
                                          A detailed walkthrough of the error, its code path and all known details is as follows:
                                          ---------------------------------------------------------------------------------------
                                          
                                          -- Head --
                                          Thread: Client thread
                                          Stacktrace:
                                          	at net.minecraft.client.gui.Gui.drawCenteredString(Gui.java:127)
                                          	at com.avonia.mod.util.handlers.RadarHandler.onRenderPre(RadarHandler.java:64)
                                          	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_16_RadarHandler_onRenderPre_Pre.invoke(.dynamic)
                                          	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
                                          	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
                                          	at net.minecraftforge.client.GuiIngameForge.pre(GuiIngameForge.java:910)
                                          	at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:119)
                                          
                                          -- Affected level --
                                          Details:
                                          	Level name: MpServer
                                          	All players: 1 total; [EntityPlayerSP['Player997'/494, l='MpServer', x=8.50, y=65.00, z=8.50]]
                                          	Chunk stats: MultiplayerChunkCache: 0, 0
                                          	Level seed: 0
                                          	Level generator: ID 00 - default, ver 1. Features enabled: false
                                          	Level generator options: 
                                          	Level spawn location: World: (8,64,8), Chunk: (at 8,4,8 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,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: creative (ID 1). Hardcore: false. Cheats: false
                                          	Forced entities: 1 total; [EntityPlayerSP['Player997'/494, 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:461)
                                          	at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2889)
                                          	at net.minecraft.client.Minecraft.run(Minecraft.java:471)
                                          	at net.minecraft.client.main.Main.main(Main.java:118)
                                          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                          	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                                          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                                          	at java.lang.reflect.Method.invoke(Method.java:498)
                                          	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(NativeMethodAccessorImpl.java:62)
                                          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                                          	at java.lang.reflect.Method.invoke(Method.java:498)
                                          	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
                                          	at GradleStart.main(GradleStart.java:25)
                                          
                                          -- System Details --
                                          Details:
                                          	Minecraft Version: 1.12.2
                                          	Operating System: Windows 10 (amd64) version 10.0
                                          	Java Version: 1.8.0_181, Oracle Corporation
                                          	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
                                          	Memory: 701521864 bytes (669 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
                                          	JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
                                          	IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
                                          	FML: MCP 9.42 Powered by Forge 14.23.5.2847 5 mods loaded, 5 mods active
                                          	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
                                          
                                          	| State  | ID        | Version      | Source                           | Signature |
                                          	|:------ |:--------- |:------------ |:-------------------------------- |:--------- |
                                          	| LCHIJA | minecraft | 1.12.2       | minecraft.jar                    | None      |
                                          	| LCHIJA | mcp       | 9.42         | minecraft.jar                    | None      |
                                          	| LCHIJA | FML       | 8.0.99.99    | forgeSrc-1.12.2-14.23.5.2847.jar | None      |
                                          	| LCHIJA | forge     | 14.23.5.2847 | forgeSrc-1.12.2-14.23.5.2847.jar | None      |
                                          	| LCHIJA | avonia    | 1.0.0        | bin                              | None      |
                                          
                                          	Loaded coremods (and transformers): 
                                          	GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 445.75' Renderer: 'GeForce GTX 1050/PCIe/SSE2'
                                          	Launched Version: 1.12.2
                                          	LWJGL: 2.9.4
                                          	OpenGL: GeForce GTX 1050/PCIe/SSE2 GL version 4.6.0 NVIDIA 445.75, NVIDIA Corporation
                                          	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: Yes
                                          	Is Modded: Definitely; Client brand changed to 'fml,forge'
                                          	Type: Client (map_client.txt)
                                          	Resource Packs: 
                                          	Current Language: English (US)
                                          	Profiler Position: N/A (disabled)
                                          	CPU: 16x AMD Ryzen 7 1700 Eight-Core Processor 
                                          
                                          1 réponse Dernière réponse Répondre Citer 0
                                          • DailyCraftD Hors-ligne
                                            DailyCraft
                                            dernière édition par

                                            il faut que tu donne une valeur de base à amountType

                                            Mes créations :

                                            Mod en cours de développement : Personal Robot (1.15.2)

                                            Datapacks : DailyCraft's Craft (beta)

                                            Je suis un membre apprécié et joueur, j'ai déjà obtenu 2 point(s) de réputation.

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

                                            MINECRAFT FORGE FRANCE © 2024

                                            Powered by NodeBB