@‘PlayFlop_’:
package fr.playflop.legitium.common.block;
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.TileEntityChest;
import net.minecraft.world.World;
public class TileEntityFluoriteChest
extends TileEntityChest
implements IInventory
{
public TileEntityFluoriteChest a;
public TileEntityFluoriteChest b;
public TileEntityFluoriteChest c;
public TileEntityFluoriteChest d;
private ItemStack[] e = new ItemStack[54];
private String f;
public void readFromNBT(NBTTagCompound paramNBTTagCompound)
{
super.readFromNBT(paramNBTTagCompound);
if (paramNBTTagCompound.hasKey("eraknight", 8)) {
this.f = paramNBTTagCompound.getString("eraknight");
}
NBTTagList localNBTTagList = paramNBTTagCompound.getTagList("Items", 10);
this.e = new ItemStack[getSizeInventory()];
for (int i = 0; i < localNBTTagList.tagCount(); i++)
{
NBTTagCompound localNBTTagCompound = localNBTTagList.getCompoundTagAt(i);
int j = localNBTTagCompound.getByte("Slot") & 0xFF;
if ((j >= 0) && (j < this.e.length)) {
this.e[j] = ItemStack.loadItemStackFromNBT(localNBTTagCompound);
}
}
}
public void writeToNBT(NBTTagCompound paramNBTTagCompound)
{
super.writeToNBT(paramNBTTagCompound);
if (hasCustomInventoryName()) {
paramNBTTagCompound.setString("eraknight", this.f);
}
NBTTagList localNBTTagList = new NBTTagList();
for (int i = 0; i < this.e.length; i++) {
if (this.e* != null)
{
NBTTagCompound localNBTTagCompound = new NBTTagCompound();
localNBTTagCompound.setByte("Slot", (byte)i);
this.e*.writeToNBT(localNBTTagCompound);
localNBTTagList.appendTag(localNBTTagCompound);
}
}
paramNBTTagCompound.setTag("Items", localNBTTagList);
}
public int getSizeInventory()
{
return this.e.length;
}
public ItemStack getStackInSlot(int paramInt)
{
return this.e[paramInt];
}
public ItemStack decrStackSize(int paramInt1, int paramInt2)
{
if (this.e[paramInt1] != null)
{
if (this.e[paramInt1].stackSize <= paramInt2)
{
ItemStack localItemStack = this.e[paramInt1];
this.e[paramInt1] = null;
markDirty();
return localItemStack;
}
ItemStack localItemStack = this.e[paramInt1].splitStack(paramInt2);
if (this.e[paramInt1].stackSize == 0) {
this.e[paramInt1] = null;
}
markDirty();
return localItemStack;
}
return null;
}
public ItemStack getStackInSlotOnClosing(int paramInt)
{
if (this.e[paramInt] != null)
{
ItemStack localItemStack = this.e[paramInt];
this.e[paramInt] = null;
return localItemStack;
}
return null;
}
public void setInventorySlotContents(int paramInt, ItemStack paramItemStack)
{
this.e[paramInt] = paramItemStack;
if ((paramItemStack != null) && (paramItemStack.stackSize > getInventoryStackLimit())) {
paramItemStack.stackSize = getInventoryStackLimit();
}
markDirty();
}
public String getInventoryName()
{
return hasCustomInventoryName() ? this.f : "inventory.era_chest";
}
public void setCustomName(String paramString)
{
this.f = paramString;
}
public boolean hasCustomInventoryName()
{
return false;
}
public int getInventoryStackLimit()
{
return 64;
}
public boolean isUseableByPlayer(EntityPlayer paramEntityPlayer)
{
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) == this;
}
public void openInventory() {}
public void closeInventory() {}
public boolean isItemValidForSlot(int paramInt, ItemStack paramItemStack)
{
return true;
}
}
J’ai mit ça dans mon client proxy
X = RenderingRegistry.getNextAvailableRenderId();
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFluoriteChest.class, new TileEntityFluoriteChestSpecialRenderer());
Donc je suppose que moi
Et le coffre est déclaré dans mon GuiHandler
Merci de ton aide, j’ai réglé mon soucis !!