MFF

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

    Ajouter un gui et un container à un bloc

    Planifier Épinglé Verrouillé Déplacé Les interfaces (GUI) et les container
    1.7.x
    129 Messages 21 Publieurs 31.6k Vues 8 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • robin4002R Hors-ligne
      robin4002 Moddeurs confirmés Rédacteurs Administrateurs
      dernière édition par robin4002

      Non mais de toute façon la 1.7.10 ne m’intéresse pas, cette version est obsolète, je ne dev plus sur cette version.
      Ça ne sert à rien d’insister.

      Suis le tutoriel sur les tile entity, il te manque que 2 fonctions dans la classe du bloc et ça devrait fonctionner.

      1 réponse Dernière réponse Répondre Citer 0
      • ZunF1xZ Hors-ligne
        ZunF1x
        dernière édition par robin4002

        Quand j’ouvre ma gui en cliquant sur le bloc mon jeu crash j’aurai besoin d’aide car je ne sais pas pourquoi:

        la classe du bloc en question

        package fr.askipie.funfight;
        
        import net.minecraft.block.Block;
        import net.minecraft.block.material.Material;
        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.world.World;
        
        public class GUITutoriel extends Block
        {
            
            public GUITutoriel(Material p_i45394_1_)
            {
                super(p_i45394_1_);
            }
            
         
            @Override
            public boolean hasTileEntity(int metadata)
            {
                return true;
            }
            
            @Override
            public TileEntity createTileEntity(World world, int metadata)
            {
                if(metadata == 0)
                {
                return new TileEntityFungie();
                }
                else if(metadata == 1)
                {
                    return new TileEntityFungie();
                }
                else if(metadata == 2)
                {
                    return new TileEntityFungie();
                }
                return null;
            }
         
        
        
            
            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
                {
                    player.openGui(FunFight.instance, 0, world, x, y, z);
                    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 void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase living, ItemStack stack)
                {
                    TileEntity tile = world.getTileEntity(x, y, z);
                    if(tile instanceof TileEntityFungie)
                    {
                        if(stack.hasDisplayName())
                        {
                            ((TileEntityFungie)tile).setCustomName(stack.getDisplayName());
                        }
                    }
        
        }
                
        }
        

        la classe du tileEntity :

        package fr.askipie.funfight;
        
        import cpw.mods.fml.common.Mod.Instance;
        import cpw.mods.fml.common.network.NetworkRegistry;
        import net.minecraft.entity.player.EntityPlayer;
        import net.minecraft.inventory.IInventory;
        import net.minecraft.item.ItemStack;
        import net.minecraft.nbt.NBTTagCompound;
        import net.minecraft.nbt.NBTTagList;
        import net.minecraft.tileentity.TileEntity;
        import net.minecraftforge.common.util.Constants;
        
        public class TileEntityFungie extends TileEntity implements IInventory
        
        {
            
            private ItemStack[] contents = new ItemStack[27];
            private String customName;
        
        
        
            @Override
            public boolean hasCustomInventoryName()
            {
                return false;
            }
        
        
        
            @Override
            public void openInventory()
            {
                
            }
        
            @Override
            public void closeInventory()
            {
                
            }
        
            
            @Override
        public void readFromNBT(NBTTagCompound compound)
        {
            super.readFromNBT(compound); // exécute ce qui se trouve dans la fonction readFromNBT de la classe mère (lecture de la position du tile entity)
            if(compound.hasKey("fungieMachine", Constants.NBT.TAG_STRING)) // si un tag custom name de type string existe
            {
                this.customName = compound.getString("fungieMachine"); // on le lit
            }
        
            NBTTagList nbttaglist = compound.getTagList("Items", Constants.NBT.TAG_COMPOUND); // on obtient la liste de tags nommée Items
            this.contents = new ItemStack[this.getSizeInventory()]; // on réinitialise le tableau
            for(int i = 0; i < nbttaglist.tagCount(); ++i) // i varie de 0 à la taille la liste
            {
                NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); // on lit le tag nbt
                int j = nbttagcompound1.getByte("Slot") & 255; // on lit à quel slot se trouve l'item stack
        
                if(j >= 0 && j < this.contents.length)
                {
                    this.contents[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); // on lit l'item stack qui se trouve dans le tag
                }
            }
        }
        
        @Override
        public void writeToNBT(NBTTagCompound compound)
        {
            super.writeToNBT(compound); // exécute se qui se trouve dans la fonction writeToNBT de la classe mère (écriture de la position du tile entity)
            if(this.hasCustomInventoryName()) // s'il y a un nom custom
            {
                compound.setString("fungieMachine", this.customName); // on le met dans le tag nbt
            }
        
            NBTTagList nbttaglist = new NBTTagList(); // on créé une nouvelle liste de tags
            for(int i = 0; i < this.contents.length; ++i) // i varie de 0 à la taille de notre tableau
            {
                if(this.contents[ i] != null) // si l'item stack à l'emplacement i du tableau n'est pas null
                {
                    NBTTagCompound nbttagcompound1 = new NBTTagCompound(); // on créé un tag nbt
                    nbttagcompound1.setByte("Slot", (byte)i); // on enregistre son emplacement dans le tableau
                    this.contents[ i].writeToNBT(nbttagcompound1); // on écrit l'item dans le tag
                    nbttaglist.appendTag(nbttagcompound1); // on ajoute le tab à la liste
                }
            }
            compound.setTag("Items", nbttaglist); // on enregistre la liste dans le tag nbt
        
        }
        
        @Override
        public int getSizeInventory()
        {
            return this.contents.length;
        }
        
        @Override
        public ItemStack getStackInSlot(int slotIndex)
        {
            return this.contents[slotIndex];
        }
        
        @Override
        public ItemStack decrStackSize(int slotIndex, int amount)
        {
            if(this.contents[slotIndex] != null) // si le contenu dans l'emplacement n'est pas null
            {
                ItemStack itemstack;
        
                if(this.contents[slotIndex].stackSize <= amount) // si la quantité est inférieur où égale à ce qu'on souhaite retirer
                {
                    itemstack = this.contents[slotIndex]; // la variable itemstack prends la valeur du contenu
                    this.contents[slotIndex] = null; // on retire ce qui est dans la variable contents
                    this.markDirty(); // met à jour le tile entity
                    return itemstack; // renvoie itemstack
                }
                else // sinon
                {
                    itemstack = this.contents[slotIndex].splitStack(amount); // la fonction splitStack(quantité) retire dans this.contents[slotIndex] le contenu et le met dans itemstack
        
                    if(this.contents[slotIndex].stackSize == 0) // au cas où la quantité passe à 0 (ce qui ne devrait pas arriver en temps normal)
                    {
                        this.contents[slotIndex] = null; // on met sur null, ça évite de se retrouver avec des itemstack bugué qui contiennent 0
                    }
                    this.markDirty(); // met à jour le tile entity
                    return itemstack; // renvoie itemstack
                }
            }
            else // sinon si le contenu dans cette emplacement est null
            {
                return null; // renvoie null, puisqu'il n'y a rien dans cette emplacement
            }
        }
        
        @Override
        public ItemStack getStackInSlotOnClosing(int slotIndex)
        {
            if(this.contents[slotIndex] != null)
            {
                ItemStack itemstack = this.contents[slotIndex];
                this.contents[slotIndex] = null;
                return itemstack;
            }
            else
            {
                return null;
            }
        }
        
        @Override
        public void setInventorySlotContents(int slotIndex, ItemStack stack)
        {
            this.contents[slotIndex] = stack; // met l'item stack dans le tableau
        
            if(stack != null && stack.stackSize > this.getInventoryStackLimit()) // si la taille de l'item stack dépasse la limite maximum de l'inventaire
            {
                stack.stackSize = this.getInventoryStackLimit(); // on le remet sur la limite
            }
        
            this.markDirty(); // met à jour le tile entity
        }
        
        @Override
        public String getInventoryName()
        {
            return this.hasCustomInventoryName() ? this.customName : "tile.cupboard";
        }
        
        public void setCustomName(String customName)
        {
            this.customName = customName;
        }
        
        @Override
        public int getInventoryStackLimit()
        {
            return 64;
        }
        
        @Override
        public boolean isUseableByPlayer(EntityPlayer player)
        {
            return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : player.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D;
        }
        
        @Override
        public boolean isItemValidForSlot(int slotIndex, ItemStack stack)
        {
            return true;
        }
        
        @Instance("funfight") // attention il doit respecter les majuscules/minuscules
        public static FunFight instance;
        
        {
        
        NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandlerFungie());
        
        }
        
        }
        
        

        Sa me soule ca marche jamais avec moi je suis vraiment nul serieux!!!

        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 faudrait un copier/coller du rapport de crash.

          ZunF1xZ 1 réponse Dernière réponse Répondre Citer 0
          • ZunF1xZ Hors-ligne
            ZunF1x @robin4002
            dernière édition par

            @robin4002 ca crash plus mais la gui ne souvre toujours pas:

            la classe du blocs:

            package fr.askipie.funfight;
            
            import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
            import net.minecraft.block.Block;
            import net.minecraft.block.material.Material;
            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.world.World;
            
            public class GUITutoriel extends Block
            {
                
                public GUITutoriel(Material p_i45394_1_)
                {
                    super(p_i45394_1_);
                }
            
                
             
                @Override
                public TileEntity createTileEntity(World world, int metadata)
                {
                    if(metadata == 0)
                    {
                    return new TileEntityFungie();
                    }
                    else if(metadata == 1)
                    {
                        return new TileEntityFungie();
                    }
                    else if(metadata == 2)
                    {
                        return new TileEntityFungie();
                    }
                    return null;
                }
             
             
             
                
                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
                    {
                        player.openGui(FunFight.instance, 0, world, x, y, z);
                        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 void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase living, ItemStack stack)
                    {
                        TileEntity tile = world.getTileEntity(x, y, z);
                        if(tile instanceof TileEntityFungie)
                        {
                            if(stack.hasDisplayName())
                            {
                                ((TileEntityFungie)tile).setCustomName(stack.getDisplayName());
                            }
                        }
            
            }
                    
            }
            
            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

              Remplaces tout ça :

                  @Override
                  public TileEntity createTileEntity(World world, int metadata)
                  {
                      if(metadata == 0)
                      {
                          return new TileEntityFungie();
                      }
                      else if(metadata == 1)
                      {
                          return new TileEntityFungie();
                      }
                      else if(metadata == 2)
                      {
                          return new TileEntityFungie();
                      }
                      return null;
                  }
              

              par juste ça :

                  @Override
                  public TileEntity createTileEntity(World world, int metadata)
                  {
                       return new TileEntityFungie();
                  }
              

              Vu que tu n’as pas de metadata toutes tes conditions sont inutiles.

              Enfin ajoutes la fonction pour indiquer que le bloc a un tile entity :

                  @Override
                  public boolean hasTileEntity(int metadata)
                  {
                      return true;
                  }
              
              ZunF1xZ 1 réponse Dernière réponse Répondre Citer 0
              • ZunF1xZ Hors-ligne
                ZunF1x @robin4002
                dernière édition par

                @robin4002 pi le crash report:

                ---- Minecraft Crash Report ----
                // This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]
                
                Time: 17/02/19 21:27
                Description: Ticking memory connection
                
                java.lang.ClassCastException: fr.askipie.funfight.GuiCupboard cannot be cast to net.minecraft.inventory.Container
                	at cpw.mods.fml.common.network.NetworkRegistry.getRemoteGuiContainer(NetworkRegistry.java:243)
                	at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:75)
                	at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2501)
                	at fr.askipie.funfight.GUITutoriel.onBlockActivated(GUITutoriel.java:46)
                	at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:409)
                	at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:593)
                	at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74)
                	at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122)
                	at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)
                	at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)
                	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)
                	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)
                	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
                	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)
                	at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)
                
                
                A detailed walkthrough of the error, its code path and all known details is as follows:
                ---------------------------------------------------------------------------------------
                
                -- Head --
                Stacktrace:
                	at cpw.mods.fml.common.network.NetworkRegistry.getRemoteGuiContainer(NetworkRegistry.java:243)
                	at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:75)
                	at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2501)
                	at fr.askipie.funfight.GUITutoriel.onBlockActivated(GUITutoriel.java:46)
                	at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:409)
                	at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:593)
                	at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74)
                	at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122)
                	at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)
                
                -- Ticking connection --
                Details:
                	Connection: net.minecraft.network.NetworkManager@15b615c
                Stacktrace:
                	at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)
                	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)
                	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)
                	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
                	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)
                	at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)
                
                -- System Details --
                Details:
                	Minecraft Version: 1.7.10
                	Operating System: Windows 8.1 (amd64) version 6.3
                	Java Version: 1.8.0_202, Oracle Corporation
                	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
                	Memory: 840750248 bytes (801 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
                	JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
                	AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
                	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
                	FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1558 4 mods loaded, 4 mods active
                	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
                	UCHIJAAAA	mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) 
                	UCHIJAAAA	FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar) 
                	UCHIJAAAA	Forge{10.13.4.1558} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar) 
                	UCHIJAAAA	funfight{1.0.0} [FunFight] (bin) 
                	GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
                	Profiler Position: N/A (disabled)
                	Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
                	Player Count: 1 / 8; [EntityPlayerMP['Player468'/149, l='New World', x=-420,72, y=1,00, z=-1869,36]]
                	Type: Integrated Server (map_client.txt)
                	Is Modded: Definitely; Client brand changed to 'fml,forge'
                
                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 c’est causé par quelque chose que je n’avais pas vu avant. Dans ta classe GuiHandlerFungie tu as inversé le contenu des fonctions rapport à ce qu’il faudrait.

                  getServerGuiElement doit retourner un container et non un gui, et l’inverse pour getClientGuiElement

                  ZunF1xZ 1 réponse Dernière réponse Répondre Citer 0
                  • ZunF1xZ Hors-ligne
                    ZunF1x @robin4002
                    dernière édition par

                    @robin4002 apres tout ce temps… ENFIN CA MARCHE !!! et c’est ou qu’on met la texture du coffre pour notre gui ?

                    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

                      Cela dépend de ce que tu as mis dans la classe GuiCupboard.
                      Il y a une variable de type ResourceLocation, le chemin indiqué dedans est l’endroit où il cherche la texture.

                      ZunF1xZ 1 réponse Dernière réponse Répondre Citer 0
                      • ZunF1xZ Hors-ligne
                        ZunF1x @robin4002
                        dernière édition par robin4002

                        @robin4002 est-ce que tu aurai une texture d’un coffre minecraft a 3 lignes stp ??

                        et puis comme je fait si je veux que mon coffre ai 6 lignes (en tout 54 slot) ???

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

                          pour avoir plus de slots c’est pas compliqué il suffit d’ajouter des slots au container puis d’augmenter la taille de l’inventaire dans le TileEntity

                          ensuite tu devras également faire une texture avec plus de ligne|colonne selon ce que tu veux faire, après tu peux aussi afficher la texture avec un algorithme qui vas positionner “des bouts de textures” a l’écran pour n’utiliser que une seul texture ou celle de minecraft déjà existante

                          ZunF1xZ 1 réponse Dernière réponse Répondre Citer 0
                          • ZunF1xZ Hors-ligne
                            ZunF1x @SpyMan
                            dernière édition par

                            @SpyMan ok mais quels lignes ?

                            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 robin4002

                              La texture de coffre à 3 lignes tu peux la trouver dans les ressource de Minecraft.
                              Et pour avoir plus de slot, il faut adapter le code du container et la taille du tableau d’itemstack du tileEntity.

                              Par contre il serait vraiment bien que tu te calmes sur les messages.
                              Je viens de faire du ménage dans la discussion, tu as posté pleins de messages en double ou inutile. Si tu n’as pas de réponse au bout de 15 minutes ça ne sert à rien de reposter un autre message, ça veut dire que je ne suis pas dispo pour répondre. (je fais d’autres choses aussi de mes journées / soirées).
                              EDIT : je viens même de voir que tu as posté d’autres messages dans une demande d’aide de quelqu’un d’autre. Arrêtes tout de suite ce genre de comportement, sinon on ne va pas bien s’entendre.

                              ZunF1xZ 1 réponse Dernière réponse Répondre Citer 0
                              • ZunF1xZ Hors-ligne
                                ZunF1x @robin4002
                                dernière édition par

                                @robin4002 mais la j’aurai besoin d’aide sur un autre truc

                                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

                                  Si c’est en rapport avec les gui et container, tu peux poster ta question ici.

                                  Sinon ouvres une demande d’aide dans la section appropriée : https://www.minecraftforgefrance.fr/category/21/support-pour-les-moddeurs

                                  ZunF1xZ 1 réponse Dernière réponse Répondre Citer 0
                                  • ZunF1xZ Hors-ligne
                                    ZunF1x @robin4002
                                    dernière édition par

                                    @robin4002 deja fait tien si tu peut m’aider

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

                                      bonjour, j’aimerai faire un GUI qui reste affiché à l’écran (pour des stat de joueur et autres variable) est-ce que qqn sais comment faire?

                                      il y aurait donc aucun bloc pour l’afficher

                                      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 robin4002

                                        Dans ce cas ce n’est pas un gui qu’il te faut, ce que tu dois faire c’est une modification du HUD (avec l’event RenderGameOverlay).

                                        Fais une recherche de ce terme sur le forum, tu devrais trouver pas mal de demande d’aide résolu.
                                        Si jamais tu as besoin d’aide, créés une demande dans la section support pour les moddeurs plutôt que poster ici (car la modif du HUD n’a rien à voir avec la création d’un gui + container pour un bloc).

                                        L BinaireB 7 réponses Dernière réponse Répondre Citer 0
                                        • L Hors-ligne
                                          Le_Vrai_GG @robin4002
                                          dernière édition par

                                          @robin4002 merci je savais pas qu’il fallais faire autres chose qu’un GUI donc j’ai posté où sa me semblais le plus logique

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

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

                                            MINECRAFT FORGE FRANCE © 2024

                                            Powered by NodeBB