MFF

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

    Ajouter un rendu avancé à votre bloc via TESR

    Planifier Épinglé Verrouillé Déplacé Les blocs
    1.7.x
    109 Messages 23 Publieurs 38.6k Vues 3 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.
    • L Hors-ligne
      Lyacos
      dernière édition par

      J’ai un problème mineur avec la texture de mon block, dans le log j’ai ceci:

      [11:35:25] [Client thread/ERROR]: Using missing texture, unable to load meubles:textures/blocks/model_block_tutoriel.png
      java.io.FileNotFoundException: meubles:textures/blocks/model_block_tutoriel.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:643) [Minecraft.class:?]
      at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:303) [FMLClientHandler.class:?]
      at net.minecraft.client.Minecraft.startGame(Minecraft.java:586) [Minecraft.class:?]
      at net.minecraft.client.Minecraft.run(Minecraft.java:931) [Minecraft.class:?]
      at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
      at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]
      at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]
      at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]
      at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
      at GradleStart.main(Unknown Source) [start/:?]
      

      En jeu la texture de mon block est bien présente sauf quand je le casse, c’est une animation du block sans texture (texture par défaut), j’ai fait une image pour mieux comprendre, à gauche mon block et sa texture et à droite le block que je détruis.

      J’ai essayé de comprendre pourquoi et je n’ai pas trouvé malheureusement. 😞

      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

        Car la texture utilisée pour les particules est celle du bloc, pas celle du TESR. Il faut donc ajouter une texture en plus de 16x16 pour les particules.

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

          Merci de ta réponse, à partir de quelle minute on voit ce passage dans ta vidéo, j’ai compris ce que tu dis mais c’est l’étape de faire le block 16x16 qui m’intéresse de voir, je fais la face avant, un côté ?

          J’ai fait ce tutoriel très tard donc…

          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

            Aucune idée x)
            Je ne connais pas par cœur tous mes tutoriels. Faire la texture pour les particules c’est exactement la même chose que faire un texture pour un bloc basique.

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

              Ok ^^, je vais prendre la texture de face de mon block, encore merci.

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

                salut j’ai un petit probleme : le carré tout moche apparait alors que le return de getRenderType est bien le bon ;

                la classe du block ```java
                package com.mathiasetampes.entreprise.common;

                import com.mathiasetampes.entreprise.proxy.ClientProxy;

                import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
                import cpw.mods.fml.relauncher.Side;
                import cpw.mods.fml.relauncher.SideOnly;
                import net.minecraft.block.Block;
                import net.minecraft.block.BlockContainer;
                import net.minecraft.block.material.Material;
                import net.minecraft.client.renderer.texture.IIconRegister;
                import net.minecraft.entity.EntityLivingBase;
                import net.minecraft.entity.item.EntityItem;
                import net.minecraft.entity.player.EntityPlayer;
                import net.minecraft.inventory.IInventory;
                import net.minecraft.item.ItemStack;
                import net.minecraft.nbt.NBTTagCompound;
                import net.minecraft.tileentity.TileEntity;
                import net.minecraft.util.IIcon;
                import net.minecraft.util.MathHelper;
                import net.minecraft.world.World;

                public class Distributeur extends BlockContainer
                {

                private IIcon front;
                protected Distributeur()
                {
                super(Material.rock); //Mettez le material qui convient
                this.setResistance(8.0F);
                this.setHarvestLevel(“pickaxe”, 2); //Outil pour casser le bloc, pour le chiffre : 0=bois, 1=pierre, 2=fer, 3=diamant
                }

                @Override
                public TileEntity createNewTileEntity(World world, int metadata) //Instancie le TileEntity
                {
                return new TileEntityDistributeur();
                }

                @Override
                public boolean hasTileEntity(int metadata) //Permet de savoir si le bloc a un TileEntity
                {
                return true;
                }
                public void breakBlock(World world, int x, int y, int z, Block block, int metadata)
                {
                TileEntity tileentity = world.getTileEntity(x, y, z);

                if (tileentity instanceof IInventory)
                {
                IInventory inv = (IInventory)tileentity;
                for (int i1 = 0; i1 < inv.getSizeInventory(); ++i1)
                {
                ItemStack itemstack = inv.getStackInSlot(i1);

                if (itemstack != null)
                {
                float f = world.rand.nextFloat() * 0.8F + 0.1F;
                float f1 = world.rand.nextFloat() * 0.8F + 0.1F;
                EntityItem entityitem;

                for (float f2 = world.rand.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; world.spawnEntityInWorld(entityitem))
                {
                int j1 = world.rand.nextInt(21) + 10;

                if (j1 > itemstack.stackSize)
                {
                j1 = itemstack.stackSize;
                }

                itemstack.stackSize -= j1;
                entityitem = new EntityItem(world, (double)((float)x + f), (double)((float)y + f1), (double)((float)z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
                float f3 = 0.05F;
                entityitem.motionX = (double)((float)world.rand.nextGaussian() * f3);
                entityitem.motionY = (double)((float)world.rand.nextGaussian() * f3 + 0.2F);
                entityitem.motionZ = (double)((float)world.rand.nextGaussian() * f3);

                if (itemstack.hasTagCompound())
                {
                entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
                }
                }
                }
                }

                world.func_147453_f(x, y, z, block);
                }

                super.breakBlock(world, x, y, z, block, metadata);
                }
                public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitx, float hity, float hitz)
                {
                if (world.isRemote)
                {
                return true;
                }
                else
                {
                FMLNetworkHandler.openGui(player, Entreprise.instance, 0, world, x, y, z);
                return true;
                }
                }
                public void registerBlockIcons(IIconRegister iiconRegister)
                {
                this.blockIcon = iiconRegister.registerIcon(“minecraft:stone”);
                }

                public boolean isOpaqueCube()
                {
                return false;
                }

                public boolean renderAsNormalBlock()
                {
                return false;
                }

                public int getRenderType()
                {
                return ClientProxy.tesrRenderId;
                }
                }

                
                du client proxy
                ```java
                package com.mathiasetampes.entreprise.proxy;
                
                import com.mathiasetampes.entreprise.client.TileEntityDistributeurSpecialRenderer;
                import com.mathiasetampes.entreprise.common.TileEntityDistributeur;
                
                import cpw.mods.fml.client.registry.ClientRegistry;
                import cpw.mods.fml.client.registry.RenderingRegistry;
                
                public class ClientProxy extends CommonProxy
                {
                public static int tesrRenderId;
                @Override
                public void registerRender()
                {
                ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDistributeur.class, new TileEntityDistributeurSpecialRenderer());
                System.out.println("méthode côté client");
                tesrRenderId = RenderingRegistry.getNextAvailableRenderId();
                RenderingRegistry.registerBlockHandler(new TESRInventoryRenderer());
                
                }
                }
                
                

                et du TESR

                package com.mathiasetampes.entreprise.proxy;
                
                import org.lwjgl.opengl.GL11;
                
                import com.mathiasetampes.entreprise.client.TileEntityDistributeurSpecialRenderer;
                import com.mathiasetampes.entreprise.common.Entreprise;
                
                import net.minecraft.block.Block;
                import net.minecraft.client.Minecraft;
                import net.minecraft.client.renderer.RenderBlocks;
                import net.minecraft.world.IBlockAccess;
                import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
                
                public class TESRInventoryRenderer implements ISimpleBlockRenderingHandler {
                
                @Override
                public void renderInventoryBlock(Block block, int metadata, int modelId,
                RenderBlocks renderer)
                {
                if(block == Entreprise.distributeur)
                {
                GL11.glPushMatrix();
                GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
                GL11.glTranslatef(0.0F, -1.0F, 0.0F);
                Minecraft.getMinecraft().getTextureManager().bindTexture(TileEntityDistributeurSpecialRenderer.texture);
                TileEntityDistributeurSpecialRenderer.model.renderAll();
                GL11.glPopMatrix();
                }
                }
                
                @Override
                public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,
                Block block, int modelId, RenderBlocks renderer)
                {
                return false;
                }
                
                @Override
                public boolean shouldRender3DInInventory(int modelId)
                {
                return true;
                }
                
                @Override
                public int getRenderId()
                {
                return 0;
                }
                
                }
                
                
                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

                  Le carré tout moche ?
                  Le "        System.out.println(“méthode côté client”);" apparaît-il dans les logs ?

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

                    oui , le carré tout moche : c’est a dire qu’au lieux d’avoir un block j’ai un carré de stone (c’est la texture que j’utilise en dessous du model )

                    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 modèle ressemble à quoi ?

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

                        a un distributeur de billet

                        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

                          Envoie le code du modèle, un screen du modèle, et un screen du rendu en jeu.

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

                            je veut bien mais c’est le rendu dans l’inventaire qui pose problème

                            modele

                            package com.mathiasetampes.entreprise.client.model;
                            
                            import net.minecraft.client.model.ModelBase;
                            import net.minecraft.client.model.ModelRenderer;
                            import net.minecraft.entity.Entity;
                            
                            public class ATMModel extends ModelBase
                            {
                             //fields
                               ModelRenderer Base;
                               ModelRenderer FrameBottom;
                               ModelRenderer Top;
                               ModelRenderer Right;
                               ModelRenderer Left;
                               ModelRenderer FrameTop;
                               ModelRenderer FrameLeft;
                               ModelRenderer FrameRight;
                               ModelRenderer Keypad;
                               ModelRenderer Panel;
                               ModelRenderer Shape6;
                               ModelRenderer CashBackPanel;
                               ModelRenderer CashSlot;
                               ModelRenderer Screen;
                               ModelRenderer Panel2;
                               ModelRenderer Panel3;
                               ModelRenderer Shape1;
                            
                             public ATMModel()
                             {
                               textureWidth = 128;
                               textureHeight = 64;
                            
                                 Base = new ModelRenderer(this, 64, 18);
                                 Base.addBox(0F, 0F, 0F, 16, 2, 16);
                                 Base.setRotationPoint(-8F, 22F, -8F);
                                 Base.setTextureSize(128, 64);
                                 Base.mirror = true;
                                 setRotation(Base, 0F, 0F, 0F);
                                 FrameBottom = new ModelRenderer(this, 0, 61);
                                 FrameBottom.addBox(0F, 0F, 0F, 14, 2, 1);
                                 FrameBottom.setRotationPoint(-7F, 21F, -8.5F);
                                 FrameBottom.setTextureSize(128, 64);
                                 FrameBottom.mirror = true;
                                 setRotation(FrameBottom, 0F, 0F, 0F);
                                 Top = new ModelRenderer(this, 64, 0);
                                 Top.addBox(0F, 0F, 0F, 16, 2, 16);
                                 Top.setRotationPoint(-8F, 8F, -8F);
                                 Top.setTextureSize(128, 64);
                                 Top.mirror = true;
                                 setRotation(Top, 0F, 0F, 0F);
                                 Right = new ModelRenderer(this, 92, 36);
                                 Right.addBox(0F, 0F, 0F, 2, 12, 16);
                                 Right.setRotationPoint(6F, 10F, -8F);
                                 Right.setTextureSize(128, 64);
                                 Right.mirror = true;
                                 setRotation(Right, 0F, 0F, 0F);
                                 Left = new ModelRenderer(this, 56, 36);
                                 Left.addBox(0F, 0F, 0F, 2, 12, 16);
                                 Left.setRotationPoint(-8F, 10F, -8F);
                                 Left.setTextureSize(128, 64);
                                 Left.mirror = true;
                                 setRotation(Left, 0F, 0F, 0F);
                                 FrameTop = new ModelRenderer(this, 0, 58);
                                 FrameTop.addBox(0F, 0F, 0F, 14, 2, 1);
                                 FrameTop.setRotationPoint(-7F, 9F, -8.5F);
                                 FrameTop.setTextureSize(128, 64);
                                 FrameTop.mirror = true;
                                 setRotation(FrameTop, 0F, 0F, 0F);
                                 FrameLeft = new ModelRenderer(this, 0, 40);
                                 FrameLeft.addBox(0F, 0F, 0F, 2, 10, 8);
                                 FrameLeft.setRotationPoint(-7F, 11F, -8.5F);
                                 FrameLeft.setTextureSize(128, 64);
                                 FrameLeft.mirror = true;
                                 setRotation(FrameLeft, 0F, 0F, 0F);
                                 FrameRight = new ModelRenderer(this, 36, 46);
                                 FrameRight.addBox(0F, 0F, 0F, 2, 10, 8);
                                 FrameRight.setRotationPoint(5F, 11F, -8.5F);
                                 FrameRight.setTextureSize(128, 64);
                                 FrameRight.mirror = true;
                                 setRotation(FrameRight, 0F, 0F, 0F);
                                 Keypad = new ModelRenderer(this, 0, 35);
                                 Keypad.addBox(-7F, 0F, 0F, 13, 4, 1);
                                 Keypad.setRotationPoint(0.5F, 20F, -4.5F);
                                 Keypad.setTextureSize(128, 64);
                                 Keypad.mirror = true;
                                 setRotation(Keypad, -1.308997F, 0F, 0F);
                                 Panel = new ModelRenderer(this, 0, 3);
                                 Panel.addBox(0F, 0F, 0F, 6, 10, 1);
                                 Panel.setRotationPoint(0F, 11.5F, -3.2F);
                                 Panel.setTextureSize(128, 64);
                                 Panel.mirror = true;
                                 setRotation(Panel, -0.2617994F, 0F, 0F);
                                 Shape6 = new ModelRenderer(this, 0, 26);
                                 Shape6.addBox(-7F, 0F, 0F, 13, 8, 1);
                                 Shape6.setRotationPoint(0.8F, 11F, -8.4F);
                                 Shape6.setTextureSize(128, 64);
                                 Shape6.mirror = true;
                                 setRotation(Shape6, 1.22173F, 0F, 0F);
                                 CashBackPanel = new ModelRenderer(this, 20, 53);
                                 CashBackPanel.addBox(0F, 0F, 0F, 5, 2, 1);
                                 CashBackPanel.setRotationPoint(-5F, 18F, -4.5F);
                                 CashBackPanel.setTextureSize(128, 64);
                                 CashBackPanel.mirror = true;
                                 setRotation(CashBackPanel, 0F, 0F, 0F);
                                 CashSlot = new ModelRenderer(this, 20, 56);
                                 CashSlot.addBox(0F, 0F, 0F, 4, 1, 1);
                                 CashSlot.setRotationPoint(-4.5F, 18.5F, -4.8F);
                                 CashSlot.setTextureSize(128, 64);
                                 CashSlot.mirror = true;
                                 setRotation(CashSlot, 0F, 0F, 0F);
                                 Screen = new ModelRenderer(this, 0, 19);
                                 Screen.addBox(0F, 0F, 0F, 5, 6, 1);
                                 Screen.setRotationPoint(-5F, 12.3F, -3F);
                                 Screen.setTextureSize(128, 64);
                                 Screen.mirror = true;
                                 setRotation(Screen, -0.2617994F, 0F, 0F);
                                 Panel2 = new ModelRenderer(this, 0, 0);
                                 Panel2.addBox(0F, 0F, 0F, 6, 2, 1);
                                 Panel2.setRotationPoint(-6F, 11.5F, -3.2F);
                                 Panel2.setTextureSize(128, 64);
                                 Panel2.mirror = true;
                                 setRotation(Panel2, -0.2617994F, 0F, 0F);
                                 Panel3 = new ModelRenderer(this, 20, 40);
                                 Panel3.addBox(0F, 0F, 0F, 1, 10, 1);
                                 Panel3.setRotationPoint(-5.7F, 11.5F, -3.2F);
                                 Panel3.setTextureSize(128, 64);
                                 Panel3.mirror = true;
                                 setRotation(Panel3, -0.2617994F, 0F, 0F);
                                 Shape1 = new ModelRenderer(this, 14, 0);
                                 Shape1.addBox(0F, 0F, 0F, 12, 12, 1);
                                 Shape1.setRotationPoint(-6F, 10F, 7F);
                                 Shape1.setTextureSize(128, 64);
                                 Shape1.mirror = true;
                                 setRotation(Shape1, 0F, 0F, 0F);
                             }
                            
                             public void renderAll()
                             {
                               Base.render(0.0625F );
                               FrameBottom.render(0.0625F );
                               Top.render(0.0625F );
                               Right.render(0.0625F );
                               Left.render(0.0625F );
                               FrameTop.render(0.0625F );
                               FrameLeft.render(0.0625F );
                               FrameRight.render(0.0625F );
                               Keypad.render(0.0625F );
                               Panel.render(0.0625F );
                               Shape6.render(0.0625F );
                               CashBackPanel.render(0.0625F );
                               CashSlot.render(0.0625F );
                               Screen.render(0.0625F );
                               Panel2.render(0.0625F );
                               Panel3.render(0.0625F );
                               Shape1.render(0.0625F );
                             }
                            
                             private void setRotation(ModelRenderer model, float x, float y, float z)
                             {
                               model.rotateAngleX = x;
                               model.rotateAngleY = y;
                               model.rotateAngleZ = z;
                             }
                            
                            }
                            
                            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

                              ah ! Il fallait le préciser plutôt.
                              Je viens de voir le problème.
                                  @Override

                              public int getRenderId()
                                  {
                                      return 0;
                                  }
                              Devrait être
                              return ClientProxy.tesrRenderId; (classe TESRInventoryRenderer)

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

                                encore moi ^^ j’ai fais en sorte de rendre le distributeur orientable mais bizarrement chaque fois que je quitte le jeu il reprend une certaine position pourtant que j’affiche le nbt de direction il a la bonne valeur

                                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

                                  Tu es sûr qu’il a la bonne valeur côté client ? À mon avis non. Ajoute ça dans l’entité de bloc

                                  ​ 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);
                                  }
                                  
                                  1 réponse Dernière réponse Répondre Citer 0
                                  • YorwanY Hors-ligne
                                    Yorwan
                                    dernière édition par

                                    merci encore j’ai l’impression de demander beaucoup d’aide en ce moment , peut etre parce que je vais pas en cour et que je passe mes journée a modée

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

                                      Bonjour, j’ai suivie le tutoriel écrit , mais malheureusement quand je lance le jeu mon bloc n’a pas de texture alors que le fichier et le chemin de la texture est bon, mais j’ai dût surement oublier ou mal fait quelque chose mais je voie pas quoi ^^ :

                                      Voici une Image en Jeu

                                      http://www.noelshack.com/2015-39-1443014545-2015-09-23-15-21-23.png

                                      [size=x-largeMes Codes :]

                                      Class ModelTable :

                                      // Date: 16/09/2015 16:55:07
                                      // Template version 1.1
                                      // Java generated by Techne
                                      // Keep in mind that you still need to fill in some blanks
                                      // - ZeuX
                                      
                                      package fr.burning.lfc.models;
                                      
                                      import net.minecraft.client.model.ModelBase;
                                      import net.minecraft.client.model.ModelRenderer;
                                      import net.minecraft.entity.Entity;
                                      
                                      public class ModelTable extends ModelBase
                                      {
                                        //fields
                                          ModelRenderer pied_1;
                                          ModelRenderer pied_2;
                                          ModelRenderer Pied_3;
                                          ModelRenderer Pied_4;
                                          ModelRenderer dessus;
                                      
                                        public ModelTable()
                                        {
                                          textureWidth = 64;
                                          textureHeight = 32;
                                      
                                            pied_1 = new ModelRenderer(this, 0, 0);
                                            pied_1.mirror = true;
                                            pied_1.addBox(0F, 0F, 0F, 1, 16, 1);
                                            pied_1.setRotationPoint(-7F, 8F, -8F);
                                            pied_1.setTextureSize(64, 32);
                                      
                                            setRotation(pied_1, 0.0174533F, 0F, 0F);
                                            pied_2 = new ModelRenderer(this, 0, 0);
                                            pied_2.mirror = true;
                                            pied_2.addBox(0F, 0F, 0F, 1, 16, 1);
                                            pied_2.setRotationPoint(6F, 8F, -8F);
                                            pied_2.setTextureSize(64, 32);
                                      
                                            setRotation(pied_2, 0F, -0.0174533F, 0F);
                                            Pied_3 = new ModelRenderer(this, 0, 0);
                                            Pied_3.mirror = true;
                                            Pied_3.addBox(0F, 0F, 0F, 1, 18, 1);
                                            Pied_3.setRotationPoint(6F, 8F, 6F);
                                            Pied_3.setTextureSize(64, 32);
                                      
                                            setRotation(Pied_3, 0F, 0F, 0F);
                                            Pied_4 = new ModelRenderer(this, 0, 0);
                                            Pied_4.mirror = true;
                                            Pied_4.addBox(0F, 0F, 0F, 1, 18, 1);
                                            Pied_4.setRotationPoint(-7F, 8F, 6F);
                                            Pied_4.setTextureSize(64, 32);
                                      
                                            setRotation(Pied_4, 0F, 0F, 0F);
                                            dessus = new ModelRenderer(this, 0, 0);
                                            dessus.mirror = true;
                                            dessus.addBox(0F, 0F, 0F, 14, 1, 15);
                                            dessus.setRotationPoint(-7F, 7.6F, -8F);
                                            dessus.setTextureSize(64, 32);
                                      
                                            setRotation(dessus, 0F, 0F, 0F);
                                        }
                                      
                                        public void renderAll()
                                        {
                                      
                                          pied_1.render(0.0625F);
                                          pied_2.render(0.0625F);
                                          Pied_3.render(0.0625F);
                                          Pied_4.render(0.0625F);
                                          dessus.render(0.0625F);
                                        }
                                      
                                        private void setRotation(ModelRenderer model, float x, float y, float z)
                                        {
                                          model.rotateAngleX = x;
                                          model.rotateAngleY = y;
                                          model.rotateAngleZ = z;
                                        }
                                      
                                      }
                                      
                                      

                                      Class TileEntityTable :

                                      %(#333333)[```java
                                      package fr.burning.lfc.tile;
                                      ]

                                      import net.minecraft.tileentity.TileEntity;

                                      public class TileEntityTable extends TileEntity 
                                      {

                                      %(#333333)[}

                                      ]
                                      
                                      ***Class TileEntityLFCSpecialRenderer :***
                                      
                                      ```java
                                      package fr.burning.lfc.tile;
                                      
                                      import org.lwjgl.opengl.GL11;
                                      
                                      import fr.burning.lfc.LaFrenchCraftMOD;
                                      import fr.burning.lfc.models.ModelTable;
                                      import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
                                      import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
                                      import net.minecraft.tileentity.TileEntity;
                                      import net.minecraft.util.ResourceLocation;
                                      
                                      public class TileEntityLFCSpecialRenderer extends TileEntitySpecialRenderer
                                      {
                                      
                                      public static ModelTable model = new ModelTable();
                                           public static ResourceLocation texture = new ResourceLocation(LaFrenchCraftMOD.MODID, "textures/models/blocks/Table.png");
                                      
                                      @Override
                                          public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialRenderTick) // la fonction qui était la de base
                                          {
                                              this.renderTileLFCAt((TileEntityTable)tile, x, y, z, partialRenderTick); // j'appelle ma fonction renderTileEntityTutorielAt en castant TileEntityTutoriel à l'argument tile
                                          }
                                      
                                          private void renderTileLFCAt(TileEntityTable tile, double x, double y, double z, float partialRenderTick) // ma propre fonction
                                          {
                                            GL11.glPushMatrix(); // ouvre une matrix
                                                 GL11.glTranslated(x + 0.5D, y + 1.5D, z + 0.5D); // déplace le bloc sur les coordonnés et le centre
                                                 GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); // met droit le bloc (par défaut il est à l'envers)
                                                 this.bindTexture(texture); // affiche la texture
                                                 model.renderAll(); // rend le modèle
                                                 GL11.glPopMatrix(); // ferme la matrix
                                          }
                                      
                                          public TileEntityLFCSpecialRenderer() // TileEntityTutorielSpecialRenderer dans mon cas, c'est la classe que nous avons fait dans la partie précédente
                                          {
                                              this.func_147497_a(TileEntityRendererDispatcher.instance);
                                          }
                                      }
                                      
                                      

                                      Class ProxyClient : 

                                      package fr.burning.lfc.lib;
                                      
                                      import cpw.mods.fml.client.registry.ClientRegistry;
                                      import cpw.mods.fml.client.registry.RenderingRegistry;
                                      import fr.burning.lfc.TESRinvRenderLFC;
                                      import fr.burning.lfc.tile.TileEntityLFCSpecialRenderer;
                                      import fr.burning.lfc.tile.TileEntityTable;
                                      
                                      public class ProxyClient extends ProxyCommon 
                                      {
                                      
                                      public static int tesrRenderId;
                                      
                                      @Override
                                      public void registerRenderInformation()
                                      {
                                        ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTable.class, new TileEntityLFCSpecialRenderer());
                                      
                                        tesrRenderId = RenderingRegistry.getNextAvailableRenderId();
                                             RenderingRegistry.registerBlockHandler(new TESRinvRenderLFC());
                                      }
                                      
                                      }
                                      
                                      

                                      %(#333333)[Voila J’espère que vous pourrez M’aider .  🙂 ]

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

                                        Est-ce que ton TESR est bien enregistré ? Rajoute des logs dans ta fonction registerRenderInformation

                                        Site web contenant mes scripts : http://SCAREXgaming.github.io

                                        Pas de demandes de support par MP ni par skype SVP.
                                        Je n'accepte sur skype que l…

                                        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

                                          Il manque la classe principale et celle du bloc.

                                          1 réponse Dernière réponse Répondre Citer 0
                                          • FolganskyF Hors-ligne
                                            Folgansky Correcteurs
                                            dernière édition par

                                            Le modèle et la texture de ton bloc est une copie conforme d’un bloc d’un mod déjà publié, je trouve dommage que tu ne t’amuses pas un peu en personnalisant ton propre mod.

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

                                            MINECRAFT FORGE FRANCE © 2024

                                            Powered by NodeBB