aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/inventories
diff options
context:
space:
mode:
authordraknyte1 <draknyte1@hotmail.com>2017-02-18 09:59:51 +1000
committerdraknyte1 <draknyte1@hotmail.com>2017-02-18 09:59:51 +1000
commit1198cdf56c8c5ec5162cd3171eecc8e72e96b3d3 (patch)
treed1042100fe5d5314c6e9ced39d90a28f56b76c48 /src/Java/gtPlusPlus/core/inventories
parent0b26602190bb40b501c15b2e7672131b97f325b6 (diff)
downloadGT5-Unofficial-1198cdf56c8c5ec5162cd3171eecc8e72e96b3d3.tar.gz
GT5-Unofficial-1198cdf56c8c5ec5162cd3171eecc8e72e96b3d3.tar.bz2
GT5-Unofficial-1198cdf56c8c5ec5162cd3171eecc8e72e96b3d3.zip
% Applied better formatting to NBT methods in the FishTrap Inventory and TileEntity. (Still doesn't properly save data, no idea why. I hate NBT.)
Diffstat (limited to 'src/Java/gtPlusPlus/core/inventories')
-rw-r--r--src/Java/gtPlusPlus/core/inventories/InventoryFishtrap.java18
1 files changed, 6 insertions, 12 deletions
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<list.tagCount();i++)
- {
+ for(int i = 0;i<list.tagCount();i++){
NBTTagCompound data = list.getCompoundTagAt(i);
int slot = data.getInteger("Slot");
- if(slot >= 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<INV_SIZE;i++)
- {
+ for(int i = 0;i<INV_SIZE;i++){
ItemStack stack = inventory[i];
- if(stack != null)
- {
+ if(stack != null){
Utils.LOG_INFO("Trying to write NBT data to inventory.");
NBTTagCompound data = new NBTTagCompound();
stack.writeToNBT(data);