From 1198cdf56c8c5ec5162cd3171eecc8e72e96b3d3 Mon Sep 17 00:00:00 2001 From: draknyte1 Date: Sat, 18 Feb 2017 09:59:51 +1000 Subject: % Applied better formatting to NBT methods in the FishTrap Inventory and TileEntity. (Still doesn't properly save data, no idea why. I hate NBT.) --- .../core/inventories/InventoryFishtrap.java | 18 ++++++---------- .../tileentities/general/TileEntityFishTrap.java | 25 ++++++---------------- 2 files changed, 12 insertions(+), 31 deletions(-) (limited to 'src/Java') diff --git a/src/Java/gtPlusPlus/core/inventories/InventoryFishtrap.java b/src/Java/gtPlusPlus/core/inventories/InventoryFishtrap.java index 7af1f08bd7..834173a768 100644 --- a/src/Java/gtPlusPlus/core/inventories/InventoryFishtrap.java +++ b/src/Java/gtPlusPlus/core/inventories/InventoryFishtrap.java @@ -25,30 +25,24 @@ public class InventoryFishTrap implements IInventory{ } - public void readFromNBT(NBTTagCompound nbt) - { + public void readFromNBT(NBTTagCompound nbt){ NBTTagList list = nbt.getTagList("Items", 10); inventory = new ItemStack[INV_SIZE]; - for(int i = 0;i= 0 && slot < INV_SIZE) - { + if(slot >= 0 && slot < INV_SIZE){ Utils.LOG_INFO("Trying to read NBT data from inventory."); inventory[slot] = ItemStack.loadItemStackFromNBT(data); } } } - public void writeToNBT(NBTTagCompound nbt) - { + public void writeToNBT(NBTTagCompound nbt){ NBTTagList list = new NBTTagList(); - for(int i = 0;i