MFF

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

    Rendu complexe de bloc via TESR

    Planifier Épinglé Verrouillé Déplacé Les blocs
    1.6.x
    215 Messages 31 Publieurs 75.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.
    • robin4002R Hors-ligne
      robin4002 Moddeurs confirmés Rédacteurs Administrateurs
      dernière édition par

      Tu as compléter ta classe TESRInventoryRenderer ou tu as la même chose qu’avant ?

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

        je l’ai completée mais sa ne change rien

        
        package Universe.common;
        
        import java.util.HashMap;
        
        import net.minecraft.block.Block;
        import net.minecraft.client.renderer.RenderBlocks;
        import net.minecraft.world.IBlockAccess;
        import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
        
        public class TESRInventoryRenderer implements ISimpleBlockRenderingHandler {
        
        public static class TESRIndex
        {
        Block block;
        int metadata;
        
        public TESRIndex(Block block, int metadata)
        {
        this.block = block;
        this.metadata = metadata;
        }
        
        @Override
        public int hashCode()
        {
        return block.hashCode() + metadata;
        }
        
        @Override
        public boolean equals(Object o)
        {
        if(!(o instanceof TESRIndex))
        return false;
        
        TESRIndex tesr = (TESRIndex)o;
        
        return tesr.block == block && tesr.metadata == metadata;
        }
        }
        
        public static HashMap <tesrindex, iinventoryrenderer="">blockByTESR = new HashMap<tesrindex, iinventoryrenderer="">();
        
        @Override
        public void renderInventoryBlock(Block block, int metadata, int modelID,
        RenderBlocks renderer) {
        // TODO Auto-generated method stub
        
        TESRIndex index = new TESRIndex(block, metadata);
        if(blockByTESR.containsKey(index))
        {
        blockByTESR.get(index).renderInventory(-0.5, -0.5, -0.5);
        }
        
        }
        
        @Override
        public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
        {
        return true;
        }
        
        @Override
        public boolean shouldRender3DInInventory()
        {
        return true;
        }
        
        @Override
        public int getRenderId()
        {
        return ClientProxy.renderInventoryTESRId;
        }
        
        }
        
        ```</tesrindex,></tesrindex,>

        Tout probleme a sa solution, s'il n'y a pas de solution c'est qu'il n'y a pas de problemes

        1 réponse Dernière réponse Répondre Citer 0
        • robin4002R Hors-ligne
          robin4002 Moddeurs confirmés Rédacteurs Administrateurs
          dernière édition par

          J’ai jamais vu ça, si tu commente le bloc tout fonctionne ?

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

            comment sa ?

            Tout probleme a sa solution, s'il n'y a pas de solution c'est qu'il n'y a pas de problemes

            1 réponse Dernière réponse Répondre Citer 0
            • robin4002R Hors-ligne
              robin4002 Moddeurs confirmés Rédacteurs Administrateurs
              dernière édition par

              // devant le GameRegistry.registerBlock

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

                rien
                je sais pas pourquoi quand je lance le monde il genere puis sa bloque et OutOf memory sinon je peux essayer de compiler le mod
                et tester avec mes 4go de ram alloués ?

                
                2014-03-04 20:32:30 [Infos] [Minecraft-Server] Preparing start region for level 0
                2014-03-04 20:32:31 [Infos] [Minecraft-Server] Preparing spawn area: 18%
                2014-03-04 20:32:32 [Infos] [Minecraft-Server] Preparing spawn area: 36%
                2014-03-04 20:32:33 [Infos] [Minecraft-Server] Preparing spawn area: 62%
                2014-03-04 20:32:34 [Infos] [Minecraft-Server] Preparing spawn area: 86%
                2014-03-04 20:32:52 [Infos] [STDERR] java.lang.OutOfMemoryError: Java heap space
                
                

                Tout probleme a sa solution, s'il n'y a pas de solution c'est qu'il n'y a pas de problemes

                1 réponse Dernière réponse Répondre Citer 0
                • robin4002R Hors-ligne
                  robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                  dernière édition par

                  @‘Bowser338’:

                  rien

                  = pas de crash ?

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

                    Petit Probleme
                    le rendu en main ne marche pas j’ai toujours le carré dans la main

                    Je n’arrive pas a integrer sa au client Proxy

                    TESRInventoryRenderer.blockByTESR.put(new TESRIndex(Universe.common.BasicSolarPanel, 0), new TileEntitySolarPanelBasicSpecialRender());
                    
                    

                    il me met une erreur la ou je dois indiquer la classe de mon bloc ( Universe.common.BasicSolarPanel )

                    Tout probleme a sa solution, s'il n'y a pas de solution c'est qu'il n'y a pas de problemes

                    1 réponse Dernière réponse Répondre Citer 0
                    • robin4002R Hors-ligne
                      robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                      dernière édition par

                      C’est pas la classe du bloc, mais l’objet du bloc qu’il faut (ClassePrincipale.nomdubloc)

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

                        Merci Erreur réglée mais quand je lance le jeu maintenant sa crash

                        
                        –-- Minecraft Crash Report ----
                        // Would you like a cupcake?
                        
                        Time: 05/03/14 16:16
                        Description: There was a severe problem during mod loading that has caused the game to fail
                        
                        cpw.mods.fml.common.LoaderException: java.lang.NullPointerException
                        at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:75)
                        at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:524)
                        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 com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
                        at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
                        at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
                        at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
                        at com.google.common.eventbus.EventBus.post(EventBus.java:267)
                        at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:201)
                        at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181)
                        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 com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
                        at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
                        at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
                        at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
                        at com.google.common.eventbus.EventBus.post(EventBus.java:267)
                        at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:112)
                        at cpw.mods.fml.common.Loader.loadMods(Loader.java:511)
                        at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:183)
                        at net.minecraft.client.Minecraft.startGame(Minecraft.java:473)
                        at net.minecraft.client.Minecraft.run(Minecraft.java:808)
                        at net.minecraft.client.main.Main.main(Main.java:93)
                        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:131)
                        at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
                        Caused by: java.lang.NullPointerException
                        at Universe.common.TESRInventoryRenderer$TESRIndex.hashCode(TESRInventoryRenderer.java:27)
                        at java.util.HashMap.hash(Unknown Source)
                        at java.util.HashMap.put(Unknown Source)
                        at Universe.common.ClientProxy.<init>(ClientProxy.java:36)
                        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
                        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
                        at java.lang.reflect.Constructor.newInstance(Unknown Source)
                        at java.lang.Class.newInstance(Unknown Source)
                        at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:58)
                        ... 33 more
                        
                        A detailed walkthrough of the error, its code path and all known details is as follows:
                        ---------------------------------------------------------------------------------------
                        
                        -- System Details --
                        Details:
                        Minecraft Version: 1.6.4
                        Operating System: Windows 7 (amd64) version 6.1
                        Java Version: 1.7.0_51, Oracle Corporation
                        Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
                        Memory: 928539264 bytes (885 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
                        JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
                        AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
                        Suspicious classes: FML and Forge are installed
                        IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
                        FML: MCP v8.11 FML v6.4.45.953 Minecraft Forge 9.11.1.953 4 mods loaded, 4 mods active
                        mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed
                        FML{6.4.45.953} [Forge Mod Loader] (bin) Unloaded->Constructed
                        Forge{9.11.1.953} [Minecraft Forge] (bin) Unloaded->Constructed
                        UltimateUniverseMod{1.0.0} [Ultimate Universe Mod] (bin) Unloaded->Errored
                        
                        

                        Je crois que c’est lié a TESRInventoryRenderer

                        donc :

                        
                        package Universe.common;
                        
                        import java.util.HashMap;
                        
                        import net.minecraft.block.Block;
                        import net.minecraft.client.renderer.RenderBlocks;
                        import net.minecraft.world.IBlockAccess;
                        import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
                        
                        public class TESRInventoryRenderer implements ISimpleBlockRenderingHandler {
                        
                        public static class TESRIndex
                        {
                        Block block;
                        int metadata;
                        
                        public TESRIndex(Block block, int metadata)
                        {
                        this.block = block;
                        this.metadata = metadata;
                        }
                        
                        @Override
                        public int hashCode()
                        {
                        return block.hashCode() + metadata;
                        }
                        
                        @Override
                        public boolean equals(Object o)
                        {
                        if(!(o instanceof TESRIndex))
                        return false;
                        
                        TESRIndex tesr = (TESRIndex)o;
                        
                        return tesr.block == block && tesr.metadata == metadata;
                        }
                        }
                        
                        public static HashMap <tesrindex, iinventoryrenderer="">blockByTESR = new HashMap<tesrindex, iinventoryrenderer="">();
                        
                        @Override
                        public void renderInventoryBlock(Block block, int metadata, int modelID,
                        RenderBlocks renderer) {
                        
                        TESRIndex index = new TESRIndex(block, metadata);
                        if(blockByTESR.containsKey(index))
                        {
                        blockByTESR.get(index).renderInventory(-0.5, -0.5, -0.5);
                        }
                        
                        }
                        
                        @Override
                        public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
                        {
                        return true;
                        }
                        
                        @Override
                        public boolean shouldRender3DInInventory()
                        {
                        return true;
                        }
                        
                        @Override
                        public int getRenderId()
                        {
                        return ClientProxy.renderInventoryTESRId;
                        }
                        
                        }
                        
                        ```</tesrindex,></tesrindex,></init>

                        Tout probleme a sa solution, s'il n'y a pas de solution c'est qu'il n'y a pas de problemes

                        1 réponse Dernière réponse Répondre Citer 0
                        • robin4002R Hors-ligne
                          robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                          dernière édition par

                          Ton bloc est null. Classe principale ?

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

                            
                            package Universe.common;
                            
                            import net.minecraft.block.Block;
                            import net.minecraft.entity.EntityCreature;
                            import net.minecraft.entity.EnumCreatureType;
                            import net.minecraftforge.common.Configuration;
                            import cpw.mods.fml.common.Mod;
                            import cpw.mods.fml.common.Mod.EventHandler;
                            import cpw.mods.fml.common.Mod.Instance;
                            import cpw.mods.fml.common.SidedProxy;
                            import cpw.mods.fml.common.event.FMLInitializationEvent;
                            import cpw.mods.fml.common.event.FMLPostInitializationEvent;
                            import cpw.mods.fml.common.event.FMLPreInitializationEvent;
                            import cpw.mods.fml.common.network.NetworkMod;
                            import cpw.mods.fml.common.registry.EntityRegistry;
                            import cpw.mods.fml.common.registry.GameRegistry;
                            import cpw.mods.fml.common.registry.LanguageRegistry;
                            
                            @Mod(modid = "UltimateUniverseMod", name = "Ultimate Universe Mod", version = "1.0.0")
                            @NetworkMod(clientSideRequired = true, serverSideRequired = false)
                            
                            public class UniverseMain
                            
                            {
                            
                            public static Block PanneauSolaireBasique;
                            
                            @SidedProxy(clientSide = "Universe.common.ClientProxy", serverSide = "Universe.common.CommonProxy")
                            public static CommonProxy proxy;
                            
                            @Instance("ModTutoriel")
                            public static UniverseMain instance;
                            
                            @EventHandler
                            public void PreInit(FMLPreInitializationEvent event)
                            {
                            
                            // Blocks
                            
                            PanneauSolaireBasique = new BasicSolarPanel(1000).setTextureName("universe:PanneauSolaireBasique").setUnlocalizedName("PSB");
                            GameRegistry.registerBlock(PanneauSolaireBasique, "PSB");
                            LanguageRegistry.addName(PanneauSolaireBasique,"Basic Solar Panel");
                            
                            }
                            
                            @EventHandler
                            public void Init(FMLInitializationEvent event)
                            {
                            
                            //Registry
                            GameRegistry.registerTileEntity(TileEntitySolarPanelBasic.class, "TileEntitySolarPanelBasic");
                            
                            proxy.registerTileEntityRender();
                            
                            }
                            
                            @EventHandler
                            public void PostInit(FMLPostInitializationEvent event)
                            {
                            
                            }
                            }
                            
                            

                            Tout probleme a sa solution, s'il n'y a pas de solution c'est qu'il n'y a pas de problemes

                            1 réponse Dernière réponse Répondre Citer 0
                            • robin4002R Hors-ligne
                              robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                              dernière édition par

                              Étrange, le bloc est bien initialisé et la méthode du proxy est appelé après l’initialisation. Je ne vois pas de raison à ce crash. Je peux voir ton ClientProxy ?

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

                                J’ai trouvé d’ou venait l’erreur des crochets en trop

                                Mais sinon toujours pas le rendu en main et dans l’inventaire 😕

                                Tout probleme a sa solution, s'il n'y a pas de solution c'est qu'il n'y a pas de problemes

                                1 réponse Dernière réponse Répondre Citer 0
                                • robin4002R Hors-ligne
                                  robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                                  dernière édition par

                                  Dans ce cas il manque toujours quelque chose. Envoie ton ClientProxy.

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

                                    package Universe.common;
                                    
                                    import net.minecraft.client.model.ModelBiped;
                                    import net.minecraft.client.renderer.entity.Render;
                                    import net.minecraft.client.renderer.entity.RenderGhast;
                                    import net.minecraft.client.renderer.entity.RenderZombie;
                                    import cpw.mods.fml.client.registry.ClientRegistry;
                                    import cpw.mods.fml.client.registry.RenderingRegistry;
                                    import Universe.common.CommonProxy;
                                    import Universe.common.TESRInventoryRenderer.TESRIndex;
                                    
                                    public class ClientProxy extends CommonProxy {
                                    @Override
                                    public void registerRender()
                                    {
                                    renderBasciSolarPanelID = RenderingRegistry.getNextAvailableRenderId();
                                    renderInventoryTESRId = RenderingRegistry.getNextAvailableRenderId();
                                    RenderingRegistry.registerBlockHandler(new TESRInventoryRenderer());
                                    RenderingRegistry.registerBlockHandler(renderBasciSolarPanelID, new RenderCustomBlocks());
                                    }
                                    public static int renderBasciSolarPanelID;
                                    
                                    public static int renderInventoryTESRId;
                                    
                                    @Override
                                    public void registerTileEntityRender()
                                    {
                                    ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySolarPanelBasic.class, new TileEntitySolarPanelBasicSpecialRender());
                                    TESRInventoryRenderer.blockByTESR.put(new TESRIndex(UniverseMain.PanneauSolaireBasique, 0), new TileEntitySolarPanelBasicSpecialRender());
                                    }
                                    }
                                    

                                    Tout probleme a sa solution, s'il n'y a pas de solution c'est qu'il n'y a pas de problemes

                                    1 réponse Dernière réponse Répondre Citer 0
                                    • robin4002R Hors-ligne
                                      robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                                      dernière édition par

                                      Ta méthode registerRender n’est pas appelé dans ta classe principale.
                                      Dans la méthode init de ta classe principale ajoute :
                                      proxy.registerRender();

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

                                        sa change rien
                                        Je commence a etre perdu la

                                        Tout probleme a sa solution, s'il n'y a pas de solution c'est qu'il n'y a pas de problemes

                                        1 réponse Dernière réponse Répondre Citer 0
                                        • robin4002R Hors-ligne
                                          robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                                          dernière édition par

                                          Dans ta classe TESRInventoryRenderer, tu as bien :

                                          @Override
                                          public int getRenderId() {
                                          return ClientProxy.renderInventoryTESRId;
                                          }
                                          

                                          ?

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

                                            Oui il y est

                                            
                                            package Universe.common;
                                            
                                            import java.util.HashMap;
                                            
                                            import net.minecraft.block.Block;
                                            import net.minecraft.client.renderer.RenderBlocks;
                                            import net.minecraft.world.IBlockAccess;
                                            import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
                                            
                                            public class TESRInventoryRenderer implements ISimpleBlockRenderingHandler {
                                            
                                            public static class TESRIndex
                                            {
                                            Block block;
                                            int metadata;
                                            
                                            public TESRIndex(Block block, int metadata)
                                            {
                                            this.block = block;
                                            this.metadata = metadata;
                                            }
                                            
                                            @Override
                                            public int hashCode()
                                            {
                                            return block.hashCode() + metadata;
                                            }
                                            
                                            @Override
                                            public boolean equals(Object o)
                                            {
                                            if(!(o instanceof TESRIndex))
                                            return false;
                                            
                                            TESRIndex tesr = (TESRIndex)o;
                                            
                                            return tesr.block == block && tesr.metadata == metadata;
                                            }
                                            }
                                            
                                            public static HashMap <tesrindex, iinventoryrenderer="">blockByTESR = new HashMap<tesrindex, iinventoryrenderer="">();
                                            
                                            @Override
                                            public void renderInventoryBlock(Block block, int metadata, int modelID,
                                            RenderBlocks renderer) {
                                            
                                            TESRIndex index = new TESRIndex(block, metadata);
                                            if(blockByTESR.containsKey(index))
                                            {
                                            blockByTESR.get(index).renderInventory(-0.5, -0.5, -0.5);
                                            }
                                            
                                            }
                                            
                                            @Override
                                            public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
                                            {
                                            return true;
                                            }
                                            
                                            @Override
                                            public boolean shouldRender3DInInventory()
                                            {
                                            return true;
                                            }
                                            
                                            @Override
                                            public int getRenderId()
                                            {
                                            return ClientProxy.renderInventoryTESRId;
                                            }
                                            
                                            }
                                            
                                            ```</tesrindex,></tesrindex,>

                                            Tout probleme a sa solution, s'il n'y a pas de solution c'est qu'il n'y a pas de problemes

                                            1 réponse Dernière réponse Répondre Citer 0
                                            • 1
                                            • 2
                                            • 5
                                            • 6
                                            • 7
                                            • 8
                                            • 9
                                            • 10
                                            • 11
                                            • 7 / 11
                                            • Premier message
                                              Dernier message
                                            Design by Woryk
                                            ContactMentions Légales

                                            MINECRAFT FORGE FRANCE © 2024

                                            Powered by NodeBB