Jump to content

TcFox

Members
  • Posts

    5
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

TcFox's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Oh um I didnt step though the debugger, Ill look for a tutorial on how to do that because it might be the problem. -Thanks!
  2. Thanks. So I followed the tutorial and modified very little, but for some reason every time I reopen the inventory my Items are deleted. I posted areas I thought would be possible culprits but I don't know whats wrong. Any suggestions for disappearing items? public class ModGuiHandler implements IGuiHandler{ @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z){ BlockPos pos = new BlockPos(x, y, z); switch(ID){ case Constants.ITEM_GAUNTLET: return new ContainerGauntlet(player, player.inventory, new InventoryGauntlet(player.getHeldItem())); } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z){ BlockPos pos = new BlockPos(x, y, z); switch (ID){ case Constants.ITEM_GAUNTLET: return new GuiItemGauntlet((ContainerGauntlet) new ContainerGauntlet(player, player.inventory, new InventoryGauntlet(player.getHeldItem()))); } return null; } } thats my guiHandler^^ public void writeToNBT(NBTTagCompound tagcompound){ NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < this.getSizeInventory(); ++i) { if (this.getStackInSlot(i) != null) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.setByte("Slot", (byte) i); this.getStackInSlot(i).writeToNBT(nbttagcompound1); nbttaglist.appendTag(nbttagcompound1); } } tagcompound.setTag(tagName, nbttaglist); } public void readFromNBT(NBTTagCompound compound) { NBTTagList items = compound.getTagList(tagName, compound.getId()); for (int i = 0; i < items.tagCount(); ++i) { NBTTagCompound item = items.getCompoundTagAt(i); byte slot = item.getByte("Slot"); if (slot >= 0 && slot < getSizeInventory()) { setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(item)); } } } read and write nbt^^ Thanks for any help
  3. Yah I saw his tutorial which is in 1.7 and I'm in 1.8 so I guess I'll have to research the capability system, Thanks!
  4. Tile Entities are only associated with Blocks?? thats my problem then because im trying to follow bedrock miners tutorial for making inventories but with an item instead of a block. Do you know of any tutorials for making Item inventories such as a backpack?
  5. The title pretty much says it all, and I did look it up for a while but i couldn't find anything, so does anyone know if it is possible to get a Tile Entity from an ItemStack/Item -Thanks!!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.