MFF

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

    Crée un coffre 9*12 avec table de craft et four integrer

    Planifier Épinglé Verrouillé Déplacé Résolu 1.7.x
    1.7.10
    22 Messages 4 Publieurs 4.1k 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.
    • Mehd95M Hors-ligne
      Mehd95
      dernière édition par

      J ai essayer de rajouter le four mais j’ai des erreurs

      Classe du Tile Entity

      package fr.yahoo.mehdiboussalem.mehdmod.common;
      
      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.network.NetworkManager;
      import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
      import net.minecraft.tileentity.TileEntity;
      import net.minecraftforge.common.util.Constants;
      
      public class MehdriumChestEntity extends TileEntity implements IInventory
      {
      private byte direction;
         private ItemStack[] contents = new ItemStack[27];
      private String customName;
      
          @Override
          public void readFromNBT(NBTTagCompound compound)
          {
              super.readFromNBT(compound);
      
             if(compound.hasKey("CustomName", Constants.NBT.TAG_STRING))
             {
                 this.customName = compound.getString("CustomName");
             }
      
             NBTTagList nbttaglist = compound.getTagList("Items", Constants.NBT.TAG_COMPOUND);
             this.contents = new ItemStack[this.getSizeInventory()];
             for(int i = 0; i < nbttaglist.tagCount(); ++i)
             {
                 NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
                 int j = nbttagcompound1.getByte("Slot") & 255;
      
                 if(j >= 0 && j < this.contents.length)
                 {
                     this.contents[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
                 }
             }
             NBTTagList nbttaglist1 = compound.getTagList("Items", 10);
             this.contents = new ItemStack[this.getSizeInventory()];
      
             for (int i = 0; i < nbttaglist1.tagCount(); ++i) //Encore une fois pour les slots
             {
                 NBTTagCompound nbttagcompound1 = nbttaglist1.getCompoundTagAt(i);
                 int j = nbttagcompound1.getByte("Slot") & 255;
      
                 if (j >= 0 && j < this.contents.length)
                 {
                     this.contents[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
                 }
             }
      
             this.workingTime = compound.getShort("workingTime"); //On lit nos valeurs
             this.workingTimeNeeded = compound.getShort("workingTimeNeeded");
          }
      
          @Override
          public void writeToNBT(NBTTagCompound compound)
          {
              super.writeToNBT(compound);
              NBTTagList nbttaglist = new NBTTagList();
              compound.setByte("Direction", this.direction);
             if(this.hasCustomInventoryName())
             {
                 compound.setString("CustomName", this.customName);
             }
      
             NBTTagList nbttaglist1 = new NBTTagList();
             for(int i = 0; i < this.contents.length; ++i)
             {
                 if(this.contents* != null)
                 {
                     NBTTagCompound nbttagcompound1 = new NBTTagCompound();
                     nbttagcompound1.setByte("Slot", (byte)i);
                     this.contents*.writeToNBT(nbttagcompound1);
                     nbttaglist1.appendTag(nbttagcompound1);
                 }
             }
             compound.setTag("Items", nbttaglist1);
             for (int i = 0; i < this.contents.length; ++i) //pour les slots
             {
                 if (this.contents* != null)
                 {
                     NBTTagCompound nbttagcompound1 = new NBTTagCompound();
                     nbttagcompound1.setByte("Slot", (byte)i);
                     this.contents*.writeToNBT(nbttagcompound1);
                     nbttaglist1.appendTag(nbttagcompound1);
                 }
             }
      
             compound.setTag("Items", nbttaglist1);
             compound.setShort("workingTime",(short)this.workingTime); //On les enregistrent en short
             compound.setShort("workingTimeNeeded", (short)this.workingTimeNeeded);
          }
      
      public byte getDirection(){
      return direction;
      
      }
      
      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);
          }
      
         @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)
             {
                 ItemStack itemstack;
      
                 if(this.contents[slotIndex].stackSize <= amount)
                 {
                     itemstack = this.contents[slotIndex];
                     this.contents[slotIndex] = null;
                     this.markDirty();
                     return itemstack;
                 }
                 else
                 {
                     itemstack = this.contents[slotIndex].splitStack(amount);
      
                     if(this.contents[slotIndex].stackSize == 0)
                     {
                         this.contents[slotIndex] = null;
                     }
                     this.markDirty();
                     return itemstack;
                 }
             }
             else
             {
                 return null;
             }
         }
      
         @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;
      
             if(stack != null && stack.stackSize > this.getInventoryStackLimit())
             {
                 stack.stackSize = this.getInventoryStackLimit();
             }
      
             this.markDirty();
         }
      
         @Override
         public String getInventoryName()
         {
             return this.hasCustomInventoryName() ? this.customName : "MehdriumChest";
         }
      
         @Override
         public boolean hasCustomInventoryName()
         {
             return this.customName != null && !this.customName.isEmpty();
         }
      
         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 void openInventory()
         {
      
         }
      
         @Override
         public void closeInventory()
         {
      
         }
      
         @Override
         public boolean isItemValidForSlot(int slotIndex, ItemStack stack)
         {
             return true;
         }
      
         private ItemStack[] contents1 = new ItemStack[4]; //0, 1 et 2 sont les inputs et 3 est l'output
      
         private int workingTime = 0; //Temps de cuisson actuel
         private int workingTimeNeeded = 200; //Temps de cuisson nécessaire
      
         public boolean isBurning()
         {
             return this.workingTime > 0;
         }
      
         private boolean canSmelt()
         {
             if (this.contents[0] == null || this.contents[1] == null || this.contents[2] == null) //Si les trois premiers slots sont vides
             {
                 return false; //On ne peut pas lancer le processus
             }
             else
             {
                 ItemStack itemstack = MehdriumChestRecipes.smelting().getSmeltingResult(new ItemStack[]{this.contents[0], this.contents[1], this.contents[2]}); //Il y a une erreur ici, c'est normal, on y vient après (c'est pour les recettes)
                 if (itemstack == null) return false; //rapport avec les recettes
                 if (this.contents[3] == null) return true; //vérifications du slot d'output
                 if (!this.contents[3].isItemEqual(itemstack)) return false; //ici aussi
                 int result = contents[3].stackSize + itemstack.stackSize;
                 return result <= getInventoryStackLimit() && result <= this.contents[3].getMaxStackSize(); //Et là aussi décidément
             }
             public void updateEntity() //Méthode exécutée à chaque tick
             {
              if(this.isBurning() && this.canSmelt()) //Si on "cuit" et que notre recette et toujours bonne, on continue
              {
              ++this.workingTime; //incrémentation
              }
              if(this.canSmelt() && !this.isBurning()) //Si la recette est bonne mais qu'elle n'est toujours pas lancée, on la lance
              {
              this.workingTime = 1; //La méthode isBurning() renverra true maintenant (1>0)
              }
              if(this.canSmelt() && this.workingTime == this.workingTimeNeeded) //Si on est arrivé au bout du temps de cuisson et que la recette est toujours bonne
              {
              this.smeltItem(); //on "cuit" les items
              this.workingTime = 0; //et on réinitialise le temps de cuisson
              }
                 if(!this.canSmelt()) //Si la recette la recette n'est plus bonne
                 {
                        this.workingTime= 0; //le temps de cuisson est de 0
                 }
             }
          }
      
      }
      
      

      classe du Container :

      package fr.yahoo.mehdiboussalem.mehdmod.common;
      
      import net.minecraft.block.Block;
      import net.minecraft.entity.player.EntityPlayer;
      import net.minecraft.entity.player.InventoryPlayer;
      import net.minecraft.inventory.Container;
      import net.minecraft.inventory.IInventory;
      import net.minecraft.inventory.InventoryCraftResult;
      import net.minecraft.inventory.InventoryCrafting;
      import net.minecraft.inventory.Slot;
      import net.minecraft.item.ItemStack;
      import net.minecraft.world.World;
      
      public class ContainerMehdriumChest extends Container
      {
      
         private final MehdriumChestEntity tileMehdriumChest;
      
         public ContainerMehdriumChest(MehdriumChestEntity tile, InventoryPlayer inventory)
         {
             this.tileMehdriumChest = tile;
             tile.openInventory();
             for(int i = 0; i < 3; ++i)
             {
                 for(int j = 0; j < 9; ++j)
                 {
                     this.addSlotToContainer(new Slot(tile, j + i * 9, 8 + j * 18, 18 + i * 18));
                 }
             }
             this.bindPlayerInventory(inventory);
         }
      
         private void bindPlayerInventory(InventoryPlayer inventory)
         {
             int i;
             for(i = 0; i < 3; ++i)
             {
                 for(int j = 0; j < 9; ++j)
                 {
                     this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 86 + i * 18));
                 }
             }
      
             for(i = 0; i < 9; ++i)
             {
                 this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 144));
             }
         }
      
         public ItemStack transferStackInSlot(EntityPlayer player, int slotIndex)
         {
             ItemStack itemstack = null;
             Slot slot = (Slot)this.inventorySlots.get(slotIndex);
      
             if(slot != null && slot.getHasStack())
             {
                 ItemStack itemstack1 = slot.getStack();
                 itemstack = itemstack1.copy();
      
                 if(slotIndex < this.tileMehdriumChest.getSizeInventory())
                 {
                     if(!this.mergeItemStack(itemstack1, this.tileMehdriumChest.getSizeInventory(), this.inventorySlots.size(), true))
                     {
                         return null;
                     }
                 }
                 else if(!this.mergeItemStack(itemstack1, 0, this.tileMehdriumChest.getSizeInventory(), false))
                 {
                     return null;
                 }
      
                 if(itemstack1.stackSize == 0)
                 {
                     slot.putStack((ItemStack)null);
                 }
                 else
                 {
                     slot.onSlotChanged();
                 }
             }
             return itemstack;
         }
      
         @Override
         public boolean canInteractWith(EntityPlayer player)
         {
             return this.tileMehdriumChest.isUseableByPlayer(player);
         }
      
         public void onContainerClosed(EntityPlayer player)
         {
             super.onContainerClosed(player);
             this.tileMehdriumChest.closeInventory();
         }
      
         public ContainerMehdriumChest(MehdriumChestEntity tile, InventoryPlayer inventory)
      {
             this.tileMehdriumChest = tile;
             this.addSlotToContainer(new Slot(tile, 0, 49, 75)); //Lancez votre jeu en debug pour calibrer vos slots
             this.addSlotToContainer(new Slot(tile, 1, 89, 75));
             this.addSlotToContainer(new Slot(tile, 2, 129, 75));
             this.addSlotToContainer(new SlotResult(tile, 3, 89, 135)); //Ici c'est un slot que j'ai créer, on le fera après
             this.bindPlayerInventory(inventory); //Les containers ont été vus dans un tutoriel de robin, merci de d'y référer
      }
      }
      

      Classe du Gui :

      package fr.yahoo.mehdiboussalem.mehdmod.common;
      
      import org.lwjgl.opengl.GL11;
      
      import net.minecraft.client.gui.inventory.GuiContainer;
      import net.minecraft.client.resources.I18n;
      import net.minecraft.entity.player.InventoryPlayer;
      import net.minecraft.inventory.IInventory;
      import net.minecraft.util.ResourceLocation;
      
      public class GuiMehdriumChest extends GuiContainer {
      
      private static final ResourceLocation textures = new ResourceLocation(MehdMod.MODID, "textures/gui/container/mehdriumchest.png");
         private MehdriumChestEntity tileMehdriumChest;
         private IInventory playerInv;
      
         public GuiMehdriumChest(MehdriumChestEntity tile, InventoryPlayer inventory)
         {
             super(new ContainerMehdriumChest(tile, inventory));
             this.tileMehdriumChest = tile;
             this.playerInv = inventory;
             this.allowUserInput = false;
             this.ySize = 170;
         }
      
         protected void drawGuiContainerForegroundLayer(int x, int y)
         {
          String tileName = this.tileMehdriumChest.hasCustomInventoryName() ? this.tileMehdriumChest.getInventoryName() : I18n.format(this.tileMehdriumChest.getInventoryName());
             this.fontRendererObj.drawString(tileName, (this.xSize /2 - this.fontRendererObj.getStringWidth(tileName)) / 2, 6,  0xFF0000);
             String invName = this.playerInv.hasCustomInventoryName() ? this.playerInv.getInventoryName() : I18n.format(this.playerInv.getInventoryName());
             this.fontRendererObj.drawString(invName, (this.xSize - this.fontRendererObj.getStringWidth(invName)) / 2, this.ySize - 96, 0);
         }
      
         @Override
         protected void drawGuiContainerBackgroundLayer(float partialRenderTick, int x, int y)
         {
          GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); // on colorise
             this.mc.getTextureManager().bindTexture(textures); // affiche la texture
             int k = (this.width - this.xSize) / 2; // on calcul la coordonnée x du point en haut à gauche
             int l = (this.height - this.ySize) / 2; // on calcul la coordonnée y du point en haut à gauche
             this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); // on desine la texture, la fonction à pour argument point x de départ, point y de départ, vecteur u, vecteur v, largeur, hauteur)
      }
         public GuiMehdriumChest(MehdriumChestEntity tile, InventoryPlayer inventory)
      {
      super(new ContainerMehdriumChest(tile, inventory));
             this.tileMehdriumChest = tile;
             this.playerInv = inventory;
             this.allowUserInput = false;
             this.ySize = 256;
             this.xSize = 256;
      }
      
      @Override
      protected void drawGuiContainerBackgroundLayer(float partialRenderTick, int x, int y)
      {
      
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
             this.mc.getTextureManager().bindTexture(textures);
             int k = (this.width - this.xSize) / 2;
             int l = (this.height - this.ySize) / 2;
             this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
             this.drawTexturedModalRect(0, 0, 176, 14, 100 + 1, 16);
      
      }
      
      protected void drawGuiContainerForegroundLayer(int x, int y)
         {
             this.fontRendererObj.drawString(this.playerInv.hasCustomInventoryName() ? this.playerInv.getInventoryName() : I18n.format(this.playerInv.getInventoryName()), 10, this.ySize - 98, 4210752);
         }
      
      }
      }
      
      1 réponse Dernière réponse Répondre Citer 0
      • BrokenSwingB Hors-ligne
        BrokenSwing Moddeurs confirmés Rédacteurs
        dernière édition par

        Balise java et non code s’il te plait et dis ou tu as des erreurs s’il te plait. On ne va pas deviner

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

          @‘BrokenSwing’:

          Balise java et non code s’il te plait et dis ou tu as des erreurs s’il te plait. On ne va pas deviner

          desoler je croyer qu’on les voyaits

          dans le Tile Entity jai le void updateEntity et smeltItem comme erreur

          dans le container j’ai  public ContainerMehdriumChest(MehdriumChestEntity tile, InventoryPlayer inventory) (j’ai 2 fois cette erreur ) comme erreur

          dans le Gui j’ai

          public GuiMehdriumChest(MehdriumChestEntity tile, InventoryPlayer inventory)
          
          protected void drawGuiContainerForegroundLayer(int x, int y)
          
          protected void drawGuiContainerBackgroundLayer(float partialRenderTick, int x, int y)
          
           public GuiMehdriumChest(MehdriumChestEntity tile, InventoryPlayer inventory)
          
          protected void drawGuiContainerBackgroundLayer(float partialRenderTick, int x, int y)
          
          protected void drawGuiContainerForegroundLayer(int x, int y)
          
          1 réponse Dernière réponse Répondre Citer 0
          • SCAREXS Hors-ligne
            SCAREX
            dernière édition par

            Oui mais ce sont quoi les erreurs ?

            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
            • Mehd95M Hors-ligne
              Mehd95
              dernière édition par

              @‘SCAREX’:

              Oui mais ce sont quoi les erreurs ?

              j’ai 2fois les meme methodes sauf que j’ai besoin des les avoir 2fois

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

                Tu regardes si les fonctions en double font des trucs différents, et si oui, tu copies le contenu d’une des fonctions dans l’autre qui porte le même nom et tu supprimes l’ancienne… ça marchera pareil (sauf pour les returns, mais il faut que tu voie au cas par cas).

                Si je vous ai aidé, n'oubliez pas d’être heureux, j'aiderai encore +

                AymericRed, moddeur expérimenté qui aide sur ce forum et qui peut accepter de faire un mod Forge rémunéré de temps en temps.

                Mes tutos : Table de craft, plugin NEI, plugin JEI, modifier l'overlay
                Je suis un membre apprécié et joueur, j'ai déjà obtenu 6 points de réputation.

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

                  Merci e crois avoir trouver la solution

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

                    Si c’est le cas, n’oublie pas la balise résolu 😉

                    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
                    • Mehd95M Hors-ligne
                      Mehd95
                      dernière édition par

                      package fr.yahoo.mehdiboussalem.mehdmod.common;
                      
                      import cpw.mods.fml.common.network.IGuiHandler;
                      import net.minecraft.entity.player.EntityPlayer;
                      import net.minecraft.tileentity.TileEntity;
                      import net.minecraft.world.World;
                      
                      public class MehdHandler implements IGuiHandler {
                      
                           @Override
                              public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
                              {
                               TileEntity tile = world.getTileEntity(x, y, z);
                        if(tile instanceof MehdriumChestEntity)
                      {
                             return new ContainerMehdriumChest((MehdriumChestEntity)tile, player.inventory);
                             }
                        else if(tile instanceof TileUltimateMehdriumChest)
                        {
                            return new ContainerUltimateMehdriumChest((TileUltimateMehdriumChest)tile,player.inventory);
                        }
                               return null;
                      
                      }
                      
                          @Override
                          public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
                          {
                              TileEntity tile = world.getTileEntity(x, y, z);
                              if(tile instanceof MehdriumChestEntity)
                              {
                                  return new GuiMehdriumChest((MehdriumChestEntity)tile, player.inventory);
                              }
                              else if (tile TileUltimateMehdriumChest){
                                  return new GuiUlitmateMehdriumChest((tileUltimateMehdriumChest)tile , player.inventory);
                      
                              }
                      
                          }
                      }
                      
                      

                      J’ai du me fail quelque part car jai des erreur sur ```java
                       return new ContainerUltimateMehdriumChest((TileUltimateMehdriumChest)tile,player.inventory);

                      et sur ```java
                      else if (tile TileUltimateMehdriumChest){
                      
                                  return new GuiUlitmateMehdriumChest((tileUltimateMehdriumChest)tile , player.inventory);
                      
                      1 réponse Dernière réponse Répondre Citer 0
                      • AymericRedA Hors-ligne
                        AymericRed
                        dernière édition par

                        “TileUltimateMehdriumChest” et “tileUltimateMehdriumChest”, il y a une différence sur le ‘t’. Et pour le if tu as oublié le instanceof.

                        Si je vous ai aidé, n'oubliez pas d’être heureux, j'aiderai encore +

                        AymericRed, moddeur expérimenté qui aide sur ce forum et qui peut accepter de faire un mod Forge rémunéré de temps en temps.

                        Mes tutos : Table de craft, plugin NEI, plugin JEI, modifier l'overlay
                        Je suis un membre apprécié et joueur, j'ai déjà obtenu 6 points de réputation.

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

                          Petit conseil pour éviter de taper n’importe quoi : commence à écrire le mot puis fait Ctrl + barre espace, ça te proposera des noms sans fautes

                          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
                          • Mehd95M Hors-ligne
                            Mehd95
                            dernière édition par

                            package fr.yahoo.mehdiboussalem.mehdmod.common;
                            
                            import cpw.mods.fml.common.network.IGuiHandler;
                            import net.minecraft.entity.player.EntityPlayer;
                            import net.minecraft.tileentity.TileEntity;
                            import net.minecraft.world.World;
                            
                            public class MehdHandler implements IGuiHandler {
                            
                                 @Override
                                    public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
                                    {
                                     TileEntity tile = world.getTileEntity(x, y, z);
                              if(tile instanceof MehdriumChestEntity)
                            {
                                   return new ContainerMehdriumChest((MehdriumChestEntity)tile, player.inventory);
                                   }
                              else if(tile instanceof TileUltimateMehdriumChest)
                              {
                                  return new ContainerUltimateMehdriumChest((TileUltimateMehdriumChest)tile,player.inventory);
                              }
                                     return null;
                            
                            }
                            
                                @Override
                                public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
                                {
                                    TileEntity tile = world.getTileEntity(x, y, z);
                                    if(tile instanceof MehdriumChestEntity)
                                    {
                                        return new GuiMehdriumChest((MehdriumChestEntity)tile, player.inventory);
                                    }
                                    else if (tile instanceof TileUltimateMehdriumChest){
                                        return new GuiUltimateMehdriumChest((TileUltimateMehdriumChest)tile , player.inventory);
                            
                                    }
                            
                                }
                            }
                            
                            

                            maintenant j’ai une erreur sur ```java
                            public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)

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

                              De 1) heuresement que j’ai vu quelle erreur c’était, mais à l’avenir dit-nous l’erreur que eclipse affiche.
                              De 2) c’est car il te manque le “return null;” à la fin de la fonction.

                              Si je vous ai aidé, n'oubliez pas d’être heureux, j'aiderai encore +

                              AymericRed, moddeur expérimenté qui aide sur ce forum et qui peut accepter de faire un mod Forge rémunéré de temps en temps.

                              Mes tutos : Table de craft, plugin NEI, plugin JEI, modifier l'overlay
                              Je suis un membre apprécié et joueur, j'ai déjà obtenu 6 points de réputation.

                              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