Navigation

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    SOLVED [1.7]Problèmes textures sur une table

    1.7.x
    5
    28
    3766
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Y
      yohannlog last edited by

      Bonjour tout le monde , j’ai un problème lors du chargement de la texture de ma table, je m’explique: J’ai fait toutes mes classes, je met mes textures pour essayer le blocs pour voir ce que sa donnait, et le je remarque que le blocs n’as pas de texture et je ne sais pas d’ou ca vient. (Je pense que le problème est tout bête a réparé mais après plusieurs fois je ne trouve pas de problème)

      Ma classe Principale:

      
      @Mod(modid = Machines.MODID, version = Machines.VERSION)
      public class Machines
      {
      public static final String MODID = "machines";
      public static final String VERSION = "1.0";
      
      @Instance(MODID)
      public static Machines instance;
      
      @SidedProxy(clientSide = "fr.yohannlog.machinesplus.ClientProxy", serverSide = "fr.yohannlog.machinesplus.CommonProxy")
      public static CommonProxy proxy;
      
      public static Block BlockTable;
      
      @EventHandler
      public void preInit(FMLPreInitializationEvent event)
      {
      BlockTable = new BlockTable(15000, Material.wood).setBlockName("BlockTable").setCreativeTab(CreativeTabs.tabBlock);
      GameRegistry.registerBlock(BlockTable, "BlockTable");
      }
      @EventHandler
      public void init(FMLInitializationEvent event)
      {
      proxy.registerRenderThings();
      proxy.registerTileEntitySpecialRenderer();
      }
      
      @EventHandler
      public void postInit(FMLPostInitializationEvent event)
      {
      
      }
      }
      
      

      Mon block Table

      
      public class BlockTable extends Block
      {
      public BlockTable(int id, Material material)
      {
      super(material);
      }
      
      public TileEntity createTileEntity(World world, int metadata)
      {
      return new TileEntityTable();
      }
      
      public boolean hasTileEntity(int metadata)
      {
      return true;
      }
      
      public boolean renderAsNormalBlock()
      {
      return false;
      }
      
      public boolean isOpaqueCube()
      {
      return false;
      }
      
      @SideOnly(Side.CLIENT)
      public int getRenderType()
      {
      return ClientProxy.renderInventoryTable;
      }
      }
      
      

      Mon ModelTable

      
      public class ModelTable extends ModelBase
      {
      //fields
      ModelRenderer Shape1;
      ModelRenderer Shape2;
      
      public ModelTable()
      {
      textureWidth = 32;
      textureHeight = 32;
      
      Shape1 = new ModelRenderer(this, 0, 0);
      Shape1.addBox(0F, 0F, 0F, 2, 13, 2);
      Shape1.setRotationPoint(-1F, 11F, 0F);
      Shape1.setTextureSize(32, 32);
      Shape1.mirror = true;
      setRotation(Shape1, 0F, 0F, 0F);
      Shape2 = new ModelRenderer(this, 0, 0);
      Shape2.addBox(-6F, -1F, -5F, 13, 1, 12);
      Shape2.setRotationPoint(0F, 11F, 0F);
      Shape2.setTextureSize(32, 32);
      Shape2.mirror = true;
      setRotation(Shape2, 0F, 0F, 0F);
      }
      
      public void render(float f)
      {
      Shape1.render(f);
      Shape2.render(f);
      }
      
      private void setRotation(ModelRenderer model, float x, float y, float z)
      {
      model.rotateAngleX = x;
      model.rotateAngleY = y;
      model.rotateAngleZ = z;
      }
      }
      
      

      Mon TableInventoryRenderer

      
      public class TableInventoryRenderer 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;
      }
      public boolean shouldRender3DInInventory(int modelId)
      {
      // TODO Auto-generated method stub
      return true;
      }
      
      @Override
      public int getRenderId()
      {
      return ClientProxy.renderInventoryTable;
      }
      
      }
      
      

      Mon tileEntity

      
      public class TileEntityTable extends TileEntity
      {
      public byte direction;
      
      public void readFromNBT(NBTTagCompound nbtTag)
      {
      super.readFromNBT(nbtTag);
      direction = nbtTag.getByte("direction");
      }
      
      public void writeToNBT(NBTTagCompound nbtTag)
      {
      nbtTag.setByte("direction", direction);
      }
      
      public void setDirection(byte direct)
      {
      direction = direct;
      }
      
      public byte getDirection()
      {
      return direction;
      }
      public Packet getDescriptionPacket()
      {
      NBTTagCompound nbttagcompound = new NBTTagCompound();
      this.writeToNBT(nbttagcompound);
      return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbttagcompound);
      }
      
      public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt)
      {
      this.readFromNBT(pkt.func_148857_g());
      this.worldObj.markBlockRangeForRenderUpdate(this.xCoord, this.yCoord, this.zCoord, this.xCoord, this.yCoord, this.zCoord);
      }
      }
      
      

      Mon tileEntitySpecialRenderer

      
      public class TileEntityTableSpecialRender extends TileEntitySpecialRenderer implements IInventoryRenderer {
      public static final ResourceLocation textureLocation = new ResourceLocation(Machines.MODID, "textures/blocks/BlockTable.png");
      private final ModelTable model = new ModelTable();
      
      public TileEntityTableSpecialRender()
      {
      this.func_147497_a(TileEntityRendererDispatcher.instance);
      }
      
      @Override
      public void renderInventory(double x, double y, double z)
      {
      this.renderTileEntityTableAt(null, x, y, z, 0.0F);
      }
      
      @Override
      public void renderTileEntityAt(TileEntity te, double x, double y, double z, float tick)
      {
      this.renderTileEntityTableAt((TileEntityTable)te, x, y, z, tick);
      }
      public void renderTileEntityTableAt(TileEntityTable te, double x, double y, double z, float tick)
      {
      GL11.glPushMatrix();
      GL11.glTranslated(x + 0.5F, y + 1.5F, z + 0.5F);
      this.bindTexture(textureLocation);
      GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
      this.model.render(0.0625F);
      GL11.glPopMatrix();
      
      }
      
      }
      
      

      et pour finir la console, je vous copie le crash:

      
      [20:58:35] [Client thread/ERROR]: Using missing texture, unable to load minecraft:textures/blocks/MISSING_ICON_BLOCK_165_BlockTable.png
      java.io.FileNotFoundException: minecraft:textures/blocks/MISSING_ICON_BLOCK_165_BlockTable.png
      at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:65) ~[FallbackResourceManager.class:?]
      at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67) ~[SimpleReloadableResourceManager.class:?]
      at net.minecraft.client.renderer.texture.TextureMap.loadTextureAtlas(TextureMap.java:126) [TextureMap.class:?]
      at net.minecraft.client.renderer.texture.TextureMap.loadTexture(TextureMap.java:91) [TextureMap.class:?]
      at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89) [TextureManager.class:?]
      at net.minecraft.client.renderer.texture.TextureManager.loadTickableTexture(TextureManager.java:71) [TextureManager.class:?]
      at net.minecraft.client.renderer.texture.TextureManager.loadTextureMap(TextureManager.java:58) [TextureManager.class:?]
      at net.minecraft.client.Minecraft.startGame(Minecraft.java:581) [Minecraft.class:?]
      at net.minecraft.client.Minecraft.run(Minecraft.java:892) [Minecraft.class:?]
      at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05]
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05]
      at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_05]
      at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
      at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
      [20:58:35] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas
      [20:58:35] [Client thread/INFO]: Created: 256x256 textures/items-atlas
      [20:58:35] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods
      [20:58:35] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:machines
      [20:58:36] [Client thread/ERROR]: Using missing texture, unable to load minecraft:textures/blocks/MISSING_ICON_BLOCK_165_BlockTable.png
      java.io.FileNotFoundException: minecraft:textures/blocks/MISSING_ICON_BLOCK_165_BlockTable.png
      at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:65) ~[FallbackResourceManager.class:?]
      at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67) ~[SimpleReloadableResourceManager.class:?]
      at net.minecraft.client.renderer.texture.TextureMap.loadTextureAtlas(TextureMap.java:126) [TextureMap.class:?]
      at net.minecraft.client.renderer.texture.TextureMap.loadTexture(TextureMap.java:91) [TextureMap.class:?]
      at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89) [TextureManager.class:?]
      at net.minecraft.client.renderer.texture.TextureManager.onResourceManagerReload(TextureManager.java:170) [TextureManager.class:?]
      at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:134) [SimpleReloadableResourceManager.class:?]
      at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:118) [SimpleReloadableResourceManager.class:?]
      at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:626) [Minecraft.class:?]
      at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:303) [FMLClientHandler.class:?]
      at net.minecraft.client.Minecraft.startGame(Minecraft.java:585) [Minecraft.class:?]
      at net.minecraft.client.Minecraft.run(Minecraft.java:892) [Minecraft.class:?]
      at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05]
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05]
      at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_05]
      at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
      at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
      [20:58:36] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas
      [20:58:36] [Client thread/INFO]: Created: 256x256 textures/items-atlas
      
      [/java
      ```]
      
      (je pense que beaucoup d'erreur seras de mon innatention)
      
      Voilà si vous avez des questions n'hésitez pas.
      
      Edit: Je précise que j'ai beaucoup essayer sur les textures et pensent que le problèmes viennent des class pour la table ou seulement a la class principale.
      
      Cordialement yohannlog</tesrindex,></tesrindex,>
      1 Reply Last reply Reply Quote 0
      • azatom
        azatom last edited by

        Mes en balise java plutot, le```
        c’est assez illisible.

        1 Reply Last reply Reply Quote 0
        • Y
          yohannlog last edited by

          Ok je le fait de suite


          C’est bon ^^

          1 Reply Last reply Reply Quote 0
          • Superloup10
            Superloup10 Modérateurs last edited by

            Dans le preInit, tu as :

            BlockTable = new BlockTable(15000, Material.wood).setBlockName("BlockTable").setCreativeTab(CreativeTabs.tabBlock);
            

            remplace par :

            BlockTable = new BlockTable(Material.wood).setBlockName("BlockTable").setCreativeTab(CreativeTabs.tabBlock);
            

            Dans la classe du bloc, tu as :

            public BlockTable(int id, Material material)
            

            à remplacer par :

            public BlockTable(Material material)
            

            Les id sont inutiles en 1.7.x.

            Ensuite, tu as :

            public static final ResourceLocation textureLocation = new ResourceLocation(Machines.MODID, "textures/blocks/BlockTable.png");
            

            à remplacer par :

            public static final ResourceLocation textureLocation = new ResourceLocation(Machines.MODID, "textures/blocks/blocktable.png");
            

            Windows n’est pas sensible à la casse, mais les archives jar, le sont.

            1 Reply Last reply Reply Quote 0
            • robin4002
              robin4002 Administrateurs Rédacteurs Moddeurs confirmés last edited by

              Vérifie que ta texture se trouve bien dans forge/src/main/resources/assets/machines/textures/blocks/
              et qu’elle s’appelle BlockTable.png ou blocktable.png si tu appliques ce que superloup t’as dit de faire.

              1 Reply Last reply Reply Quote 0
              • Y
                yohannlog last edited by

                Je vais essayer, mais sinon robin j’ai tout tester pour les textures mais je vais reesayer


                Pour la texture du blockTable, ca doit être la texture du block normal ou celui de techne?

                1 Reply Last reply Reply Quote 0
                • robin4002
                  robin4002 Administrateurs Rédacteurs Moddeurs confirmés last edited by

                  Du bloc techne.

                  1 Reply Last reply Reply Quote 0
                  • Y
                    yohannlog last edited by

                    Hum j’ai fait ce que vous dites mais, le bloc est en invisible quand je le pose est d’ailleur aussi dans mon inventaire

                    C’est dus a quoi?

                    1 Reply Last reply Reply Quote 0
                    • robin4002
                      robin4002 Administrateurs Rédacteurs Moddeurs confirmés last edited by

                      Je vois pas d’erreur dans ton code, envoie ta classe ClientProxy ?
                      Le fichier de la texture a bien de la couleur au bon endroit ?

                      1 Reply Last reply Reply Quote 0
                      • Y
                        yohannlog last edited by

                        
                        public class ClientProxy extends CommonProxy
                        {
                        public static int renderInventoryTable;
                        
                        public void registerRender()
                        {
                        renderInventoryTable = RenderingRegistry.getNextAvailableRenderId();
                        RenderingRegistry.registerBlockHandler(new TableInventoryRenderer());
                        }
                        
                        public void registerTileEntityRender()
                        {
                        ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTable.class, new TileEntityTableSpecialRender());
                        TableInventoryRenderer.blockByTESR.put(new TESRIndex(Machines.BlockTable, 0), new TileEntityTableSpecialRender());
                        }
                        }
                        
                        

                        La texture est celle qu’il fait par defualt (donc vert, rouge, bleu)…

                        1 Reply Last reply Reply Quote 0
                        • robin4002
                          robin4002 Administrateurs Rédacteurs Moddeurs confirmés last edited by

                          Ah si je viens de voir le problème. TileEntityTable n’est pas enregistré.
                          GameRegistry.registerTileEntity(TileEntityTable.class, “nom”); dans la fonction init.

                          1 Reply Last reply Reply Quote 0
                          • Y
                            yohannlog last edited by

                            
                            public static Block BlockTable;
                            public static Block BlockRuby;
                            
                            public static Item Glass, Gourde, GourdeFull; // Verre
                            
                            @EventHandler
                            public void preInit(FMLPreInitializationEvent event)
                            {
                            BlockTable = new BlockTable(Material.wood).setBlockName("blocktable").setCreativeTab(CreativeTabs.tabBlock);
                            BlockRuby = new BlockRuby (15000, Material.rock).setBlockName("BlockRuby").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("machines:BlockRuby");
                            
                            Gourde = new Gourde().setFull3D().setMaxStackSize(1).setUnlocalizedName("Gourde_vide").setTextureName("machines:gourde_vide");
                            GourdeFull = new GourdeFull().setFull3D().setUnlocalizedName("Gourde_Full").setTextureName("machines:Gourde_Full");
                            GameRegistry.registerItem(Gourde, "Gourde");
                            GameRegistry.registerItem(GourdeFull, "Gourde_Full");
                            
                            GameRegistry.registerBlock(BlockTable, "blocktable");
                            GameRegistry.registerBlock(BlockRuby, "BlockRuby");
                            }
                            
                            @EventHandler
                            public void init(FMLInitializationEvent event)
                            {
                            
                            proxy.registerRender();
                            GameRegistry.registerTileEntity(TileEntityTable.class, "blocktable");
                            }
                            
                            

                            Sinon le block est en invisible, si tu n’as aucune aide je verrai si c’est la texture


                            Je l’ai mis en haut de proxy et en bas et la texture est invisible


                            Ne fait pas attention au BlockRuby

                            1 Reply Last reply Reply Quote 0
                            • robin4002
                              robin4002 Administrateurs Rédacteurs Moddeurs confirmés last edited by

                              Il te manque proxy.registerTileEntityRender(); dans la fonction init.

                              1 Reply Last reply Reply Quote 0
                              • Y
                                yohannlog last edited by

                                Merci, l’item apparait bien mais quand je pose le bloc, le block apparait et disparait (et devient sans texture (invisible)), quand je le pose et deco-reco, le block a la texture, c’est quoi qui fait ca?

                                1 Reply Last reply Reply Quote 0
                                • robin4002
                                  robin4002 Administrateurs Rédacteurs Moddeurs confirmés last edited by

                                  C’est très étrange, j’ai encore jamais vu ça.
                                  Tu pourrais renvoyer ton code actuel ?

                                  1 Reply Last reply Reply Quote 0
                                  • Y
                                    yohannlog last edited by

                                    
                                    @Mod(modid = Machines.MODID, version = Machines.VERSION)
                                    public class Machines
                                    {
                                    public static final String MODID = "machines";
                                    public static final String VERSION = "1.0";
                                    
                                    @Instance(MODID)
                                    public static Machines instance;
                                    
                                    @SidedProxy(clientSide = "fr.yohannlog.machinesplus.ClientProxy", serverSide = "fr.yohannlog.machinesplus.CommonProxy")
                                    public static CommonProxy proxy;
                                    
                                    public static Block BlockTable;
                                    public static Block BlockRuby;
                                    
                                    public static Item Glass, Gourde, GourdeFull; // Verre
                                    
                                    @EventHandler
                                    public void preInit(FMLPreInitializationEvent event)
                                    {
                                    BlockTable = new BlockTable(Material.wood).setBlockName("blocktable").setCreativeTab(CreativeTabs.tabBlock);
                                    BlockRuby = new BlockRuby (15000, Material.rock).setBlockName("BlockRuby").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("machines:BlockRuby");
                                    
                                    Gourde = new Gourde().setFull3D().setMaxStackSize(1).setUnlocalizedName("Gourde_vide").setTextureName("machines:gourde_vide");
                                    GourdeFull = new GourdeFull().setFull3D().setUnlocalizedName("Gourde_Full").setTextureName("machines:Gourde_Full");
                                    GameRegistry.registerItem(Gourde, "Gourde");
                                    GameRegistry.registerItem(GourdeFull, "Gourde_Full");
                                    
                                    GameRegistry.registerBlock(BlockTable, "blocktable");
                                    GameRegistry.registerBlock(BlockRuby, "BlockRuby");
                                    }
                                    
                                    @EventHandler
                                    public void init(FMLInitializationEvent event)
                                    {
                                    
                                    proxy.registerRender();
                                    proxy.registerTileEntityRender();
                                    GameRegistry.registerTileEntity(TileEntityTable.class, "blocktable");
                                    }
                                    
                                    @EventHandler
                                    public void postInit(FMLPostInitializationEvent event)
                                    {
                                    
                                    }
                                    }
                                    
                                    

                                    BlockTable:

                                    
                                    public class BlockTable extends Block
                                    {
                                    
                                    public BlockTable(Material material)
                                    {
                                    super(material);
                                    }
                                    
                                    public TileEntity createTileEntity(World world, int metadata)
                                    {
                                    return new TileEntityTable();
                                    }
                                    
                                    public boolean hasTileEntity(int metadata)
                                    {
                                    return true;
                                    }
                                    
                                    public boolean renderAsNormalBlock()
                                    {
                                    return false;
                                    }
                                    
                                    public boolean isOpaqueCube()
                                    {
                                    return false;
                                    }
                                    
                                    @SideOnly(Side.CLIENT)
                                    public int getRenderType()
                                    {
                                    return ClientProxy.renderInventoryTable;
                                    }
                                    
                                    

                                    TileEntityTable:

                                    
                                    public class TileEntityTable extends TileEntity
                                    {
                                    public byte direction;
                                    
                                    public void readFromNBT(NBTTagCompound nbtTag)
                                    {
                                    super.readFromNBT(nbtTag);
                                    direction = nbtTag.getByte("direction");
                                    }
                                    
                                    public void writeToNBT(NBTTagCompound nbtTag)
                                    {
                                    nbtTag.setByte("direction", direction);
                                    }
                                    
                                    public void setDirection(byte direct)
                                    {
                                    direction = direct;
                                    }
                                    
                                    public byte getDirection()
                                    {
                                    return direction;
                                    }
                                    public Packet getDescriptionPacket()
                                    {
                                    NBTTagCompound nbttagcompound = new NBTTagCompound();
                                    this.writeToNBT(nbttagcompound);
                                    return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbttagcompound);
                                    }
                                    
                                    public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt)
                                    {
                                    this.readFromNBT(pkt.func_148857_g());
                                    this.worldObj.markBlockRangeForRenderUpdate(this.xCoord, this.yCoord, this.zCoord, this.xCoord, this.yCoord, this.zCoord);
                                    }
                                    }
                                    
                                    

                                    ModelTable

                                    
                                    public class ModelTable extends ModelBase
                                    {
                                    //fields
                                    ModelRenderer Shape1;
                                    ModelRenderer Shape2;
                                    
                                    public ModelTable()
                                    {
                                    textureWidth = 32;
                                    textureHeight = 32;
                                    
                                    Shape1 = new ModelRenderer(this, 0, 0);
                                    Shape1.addBox(0F, 0F, 0F, 2, 13, 2);
                                    Shape1.setRotationPoint(-1F, 11F, 0F);
                                    Shape1.setTextureSize(32, 32);
                                    Shape1.mirror = true;
                                    setRotation(Shape1, 0F, 0F, 0F);
                                    Shape2 = new ModelRenderer(this, 0, 0);
                                    Shape2.addBox(-6F, -1F, -5F, 13, 1, 12);
                                    Shape2.setRotationPoint(0F, 11F, 0F);
                                    Shape2.setTextureSize(32, 32);
                                    Shape2.mirror = true;
                                    setRotation(Shape2, 0F, 0F, 0F);
                                    }
                                    
                                    public void render(float f)
                                    {
                                    Shape1.render(f);
                                    Shape2.render(f);
                                    }
                                    
                                    private void setRotation(ModelRenderer model, float x, float y, float z)
                                    {
                                    model.rotateAngleX = x;
                                    model.rotateAngleY = y;
                                    model.rotateAngleZ = z;
                                    }
                                    
                                    }
                                    
                                    

                                    TableInventoryRenderer:

                                    
                                    public class TableInventoryRenderer 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;
                                    }
                                    
                                    public boolean shouldRender3DInInventory(int modelId)
                                    {
                                    // TODO Auto-generated method stub
                                    return true;
                                    }
                                    
                                    @Override
                                    public int getRenderId()
                                    {
                                    return ClientProxy.renderInventoryTable;
                                    }
                                    
                                    }
                                    
                                    

                                    TileEntityTable:

                                    
                                    public class TileEntityTable extends TileEntity
                                    {
                                    public byte direction;
                                    
                                    public void readFromNBT(NBTTagCompound nbtTag)
                                    {
                                    super.readFromNBT(nbtTag);
                                    direction = nbtTag.getByte("direction");
                                    }
                                    
                                    public void writeToNBT(NBTTagCompound nbtTag)
                                    {
                                    nbtTag.setByte("direction", direction);
                                    }
                                    
                                    public void setDirection(byte direct)
                                    {
                                    direction = direct;
                                    }
                                    
                                    public byte getDirection()
                                    {
                                    return direction;
                                    }
                                    public Packet getDescriptionPacket()
                                    {
                                    NBTTagCompound nbttagcompound = new NBTTagCompound();
                                    this.writeToNBT(nbttagcompound);
                                    return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbttagcompound);
                                    }
                                    
                                    public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt)
                                    {
                                    this.readFromNBT(pkt.func_148857_g());
                                    this.worldObj.markBlockRangeForRenderUpdate(this.xCoord, this.yCoord, this.zCoord, this.xCoord, this.yCoord, this.zCoord);
                                    }
                                    }
                                    
                                    

                                    TileEntityTableSpecialRenderer:

                                    
                                    public class TileEntityTableSpecialRender extends TileEntitySpecialRenderer implements IInventoryRenderer {
                                    public static final ResourceLocation textureLocation = new ResourceLocation(Machines.MODID, "textures/blocks/blocktable.png");
                                    private final ModelTable model = new ModelTable();
                                    
                                    public TileEntityTableSpecialRender()
                                    {
                                    this.func_147497_a(TileEntityRendererDispatcher.instance);
                                    }
                                    
                                    @Override
                                    public void renderInventory(double x, double y, double z)
                                    {
                                    this.renderTileEntityTableAt(null, x, y, z, 0.0F);
                                    }
                                    
                                    @Override
                                    public void renderTileEntityAt(TileEntity te, double x, double y, double z, float tick)
                                    {
                                    this.renderTileEntityTableAt((TileEntityTable)te, x, y, z, tick);
                                    }
                                    public void renderTileEntityTableAt(TileEntityTable te, double x, double y, double z, float tick)
                                    {
                                    GL11.glPushMatrix();
                                    GL11.glTranslated(x + 0.5F, y + 1.5F, z + 0.5F);
                                    this.bindTexture(textureLocation);
                                    GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
                                    this.model.render(0.0625F);
                                    GL11.glPopMatrix();
                                    
                                    }
                                    
                                    }
                                    
                                    

                                    ClientProxy:

                                    
                                    public class ClientProxy extends CommonProxy
                                    {
                                    public static int renderInventoryTable;
                                    
                                    public void registerRender()
                                    {
                                    renderInventoryTable = RenderingRegistry.getNextAvailableRenderId();
                                    RenderingRegistry.registerBlockHandler(new TableInventoryRenderer());
                                    }
                                    
                                    public void registerTileEntityRender()
                                    {
                                    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTable.class, new TileEntityTableSpecialRender());
                                    TableInventoryRenderer.blockByTESR.put(new TESRIndex(Machines.BlockTable, 0), new TileEntityTableSpecialRender());
                                    }
                                    }
                                    
                                    

                                    CommonProxy:

                                    
                                    public class CommonProxy
                                    {
                                    public static int renderInventoryTable;
                                    private static final Map <string, nbttagcompound="">extendedEntityData = new HashMap<string, nbttagcompound="">();
                                    
                                    public static void storeEntityData(String name, NBTTagCompound compound)
                                    {
                                    extendedEntityData.put(name, compound);
                                    }
                                    
                                    public static NBTTagCompound getEntityData(String name)
                                    {
                                    return extendedEntityData.remove(name);
                                    }
                                    
                                    public void registerRender()
                                    {
                                    System.out.println("[Energie Mod] Methode executé côter SERVEUR");
                                    }
                                    
                                    public void registerTileEntityRender() {
                                    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTable.class, new TileEntityTableSpecialRender());
                                    TableInventoryRenderer.blockByTESR.put(new TESRIndex(Machines.BlockTable, 0), new TileEntityTableSpecialRender());
                                    }
                                    }
                                    
                                    

                                    Voila, au pire si tu trouve pas je ferai une vidéo pour te montrer</string,></string,></tesrindex,></tesrindex,>

                                    1 Reply Last reply Reply Quote 0
                                    • robin4002
                                      robin4002 Administrateurs Rédacteurs Moddeurs confirmés last edited by

                                      Dans le CommonProxy, la fonction registerTileEntityRender devrait être vide sinon ça va crash.

                                      Mais pour le problème d’invisibilité, je vois pas d’où ça vient 😕

                                      1 Reply Last reply Reply Quote 0
                                      • Y
                                        yohannlog last edited by

                                        Je ne peux faire de vidéos pour le moment, y a t-il un moyen de te montrer?

                                        1 Reply Last reply Reply Quote 0
                                        • robin4002
                                          robin4002 Administrateurs Rédacteurs Moddeurs confirmés last edited by

                                          M’envoyer le mod ?

                                          1 Reply Last reply Reply Quote 0
                                          • Y
                                            yohannlog last edited by

                                            http://www.mediafire.com/download/5vd4i13ruh2tz2i/mods_1.7.2.rar

                                            J’ai que ca a mettre: pour les map (pour la map, créer s-en une, la table est dans la tabBlock tout en bas nommée tile.blocktable.name (j’ai pas mis de nom pour le moment)

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post
                                            Design by Woryk
                                            Contact / Mentions Légales / Faire un don

                                            MINECRAFT FORGE FRANCE © 2018

                                            Powered by NodeBB