MFF

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

    [1.7]Problèmes textures sur une table

    Planifier Épinglé Verrouillé Déplacé Résolu 1.7.x
    28 Messages 5 Publieurs 4.7k 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.
    • azatomA Hors-ligne
      azatom
      dernière édition par

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

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

        Ok je le fait de suite


        C’est bon ^^

        1 réponse Dernière réponse Répondre Citer 0
        • Superloup10S Hors-ligne
          Superloup10 Modérateurs
          dernière édition par

          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.

          Si vous souhaitez me faire un don, il vous suffit de cliquer sur le bouton situé en dessous.

          Je suis un membre apprécié et joueur, j'ai déjà obtenu 17 points de réputation.

          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

            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 réponse Dernière réponse Répondre Citer 0
            • Y Hors-ligne
              yohannlog
              dernière édition par

              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 réponse Dernière réponse Répondre Citer 0
              • robin4002R Hors-ligne
                robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                dernière édition par

                Du bloc techne.

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

                  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 réponse Dernière réponse Répondre Citer 0
                  • robin4002R Hors-ligne
                    robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                    dernière édition par

                    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 réponse Dernière réponse Répondre Citer 0
                    • Y Hors-ligne
                      yohannlog
                      dernière édition par

                      
                      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 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 si je viens de voir le problème. TileEntityTable n’est pas enregistré.
                        GameRegistry.registerTileEntity(TileEntityTable.class, “nom”); dans la fonction init.

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

                          
                          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 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 te manque proxy.registerTileEntityRender(); dans la fonction init.

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

                              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 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 très étrange, j’ai encore jamais vu ça.
                                Tu pourrais renvoyer ton code actuel ?

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

                                  
                                  @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 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 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 réponse Dernière réponse Répondre Citer 0
                                    • Y Hors-ligne
                                      yohannlog
                                      dernière édition par

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

                                      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

                                        M’envoyer le mod ?

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

                                          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 réponse Dernière réponse Répondre Citer 0
                                          • robin4002R Hors-ligne
                                            robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                                            dernière édition par

                                            Pourquoi tu as envoyé tout forge o_O
                                            Le dossier src suffit largement.

                                            Bon visiblement le problème vient du tile entity, comme tu n’utilises pas la direction, il doit être vide :

                                            package fr.yohannlog.machinesplus;
                                            
                                            import net.minecraft.tileentity.TileEntity;
                                            
                                            public class TileEntityTable extends TileEntity
                                            {
                                            
                                            }
                                            
                                            1 réponse Dernière réponse Répondre Citer 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • Premier message
                                              Dernier message
                                            Design by Woryk
                                            ContactMentions Légales

                                            MINECRAFT FORGE FRANCE © 2024

                                            Powered by NodeBB