diff --git a/src/main/java/mekanism/common/block/BlockMachine.java b/src/main/java/mekanism/common/block/BlockMachine.java index 1b447b13f..fbc0f521b 100644 --- a/src/main/java/mekanism/common/block/BlockMachine.java +++ b/src/main/java/mekanism/common/block/BlockMachine.java @@ -913,21 +913,21 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IBlo TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(x, y, z); ItemStack itemStack = new ItemStack(this, 1, world.getBlockMetadata(x, y, z)); - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } if(tileEntity instanceof IUpgradeTile) { - ((IUpgradeTile)tileEntity).getComponent().write(itemStack.stackTagCompound); + ((IUpgradeTile)tileEntity).getComponent().write(itemStack.getTagCompound()); } if(tileEntity instanceof ISideConfiguration) { ISideConfiguration config = (ISideConfiguration)tileEntity; - config.getConfig().write(itemStack.stackTagCompound); + config.getConfig().write(itemStack.getTagCompound()); } if(tileEntity instanceof ISustainedData) @@ -938,7 +938,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IBlo if(tileEntity instanceof IRedstoneControl) { IRedstoneControl control = (IRedstoneControl)tileEntity; - itemStack.stackTagCompound.setInteger("controlType", control.getControlType().ordinal()); + itemStack.getTagCompound().setInteger("controlType", control.getControlType().ordinal()); } if(tileEntity instanceof IStrictEnergyStorage) diff --git a/src/main/java/mekanism/common/inventory/InventoryBin.java b/src/main/java/mekanism/common/inventory/InventoryBin.java index a56ae67fc..979bfd1c6 100644 --- a/src/main/java/mekanism/common/inventory/InventoryBin.java +++ b/src/main/java/mekanism/common/inventory/InventoryBin.java @@ -97,22 +97,22 @@ public class InventoryBin public int getItemCount() { - if(bin.stackTagCompound == null) + if(bin.getTagCompound() == null) { return 0; } - return bin.stackTagCompound.getInteger("itemCount"); + return bin.getTagCompound().getInteger("itemCount"); } public void setItemCount(int count) { - if(bin.stackTagCompound == null) + if(bin.getTagCompound() == null) { bin.setTagCompound(new NBTTagCompound()); } - bin.stackTagCompound.setInteger("itemCount", Math.max(0, count)); + bin.getTagCompound().setInteger("itemCount", Math.max(0, count)); if(getItemCount() == 0) { @@ -122,29 +122,29 @@ public class InventoryBin public ItemStack getItemType() { - if(bin.stackTagCompound == null || getItemCount() == 0) + if(bin.getTagCompound() == null || getItemCount() == 0) { return null; } - return ItemStack.loadItemStackFromNBT(bin.stackTagCompound.getCompoundTag("storedItem")); + return ItemStack.loadItemStackFromNBT(bin.getTagCompound().getCompoundTag("storedItem")); } public void setItemType(ItemStack stack) { - if(bin.stackTagCompound == null) + if(bin.getTagCompound() == null) { bin.setTagCompound(new NBTTagCompound()); } if(stack == null) { - bin.stackTagCompound.removeTag("storedItem"); + bin.getTagCompound().removeTag("storedItem"); return; } ItemStack ret = StackUtils.size(stack, 1); - bin.stackTagCompound.setTag("storedItem", StackUtils.size(stack, 1).writeToNBT(new NBTTagCompound())); + bin.getTagCompound().setTag("storedItem", StackUtils.size(stack, 1).writeToNBT(new NBTTagCompound())); } } diff --git a/src/main/java/mekanism/common/item/ItemAtomicDisassembler.java b/src/main/java/mekanism/common/item/ItemAtomicDisassembler.java index 992043bf5..1a568a717 100644 --- a/src/main/java/mekanism/common/item/ItemAtomicDisassembler.java +++ b/src/main/java/mekanism/common/item/ItemAtomicDisassembler.java @@ -277,12 +277,12 @@ public class ItemAtomicDisassembler extends ItemEnergized public int getMode(ItemStack itemStack) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return 0; } - return itemStack.stackTagCompound.getInteger("mode"); + return itemStack.getTagCompound().getInteger("mode"); } public String getModeName(ItemStack itemStack) @@ -308,12 +308,12 @@ public class ItemAtomicDisassembler extends ItemEnergized public void toggleMode(ItemStack itemStack) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.stackTagCompound.setInteger("mode", getMode(itemStack) < 4 ? getMode(itemStack)+1 : 0); + itemStack.getTagCompound().setInteger("mode", getMode(itemStack) < 4 ? getMode(itemStack)+1 : 0); } @Override diff --git a/src/main/java/mekanism/common/item/ItemBlockBasic.java b/src/main/java/mekanism/common/item/ItemBlockBasic.java index d7ad13051..269928369 100644 --- a/src/main/java/mekanism/common/item/ItemBlockBasic.java +++ b/src/main/java/mekanism/common/item/ItemBlockBasic.java @@ -96,22 +96,22 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem public BaseTier getTier(ItemStack itemstack) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { return BaseTier.BASIC; } - return BaseTier.values()[itemstack.stackTagCompound.getInteger("tier")]; + return BaseTier.values()[itemstack.getTagCompound().getInteger("tier")]; } public void setTier(ItemStack itemstack, BaseTier tier) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { itemstack.setTagCompound(new NBTTagCompound()); } - itemstack.stackTagCompound.setInteger("tier", tier.ordinal()); + itemstack.getTagCompound().setInteger("tier", tier.ordinal()); } @Override @@ -168,7 +168,7 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem @Override public boolean hasContainerItem(ItemStack stack) { - return stack.getItemDamage() == 6 && stack.stackTagCompound != null && stack.stackTagCompound.hasKey("newCount"); + return stack.getItemDamage() == 6 && stack.getTagCompound() != null && stack.getTagCompound().hasKey("newCount"); } @Override @@ -182,7 +182,7 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem } } - if(stack.stackTagCompound == null || !stack.stackTagCompound.hasKey("newCount")) + if(stack.getTagCompound() == null || !stack.getTagCompound().hasKey("newCount")) { return true; } @@ -195,13 +195,13 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem { if(Block.getBlockFromItem(this) == MekanismBlocks.BasicBlock) { - if(stack.getItemDamage() != 6 || stack.stackTagCompound == null || !stack.stackTagCompound.hasKey("newCount")) + if(stack.getItemDamage() != 6 || stack.getTagCompound() == null || !stack.getTagCompound().hasKey("newCount")) { return null; } ItemStack ret = stack.copy(); - ret.stackTagCompound.setInteger("itemCount", stack.stackTagCompound.getInteger("newCount")); + ret.getTagCompound().setInteger("itemCount", stack.getTagCompound().getInteger("newCount")); return ret; } @@ -218,7 +218,7 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem { if(Block.getBlockFromItem(this) == MekanismBlocks.BasicBlock) { - if(stack.getItemDamage() == 6 && stack.stackTagCompound != null) + if(stack.getItemDamage() == 6 && stack.getTagCompound() != null) { TileEntityBin tileEntity = (TileEntityBin)world.getTileEntity(x, y, z); InventoryBin inv = new InventoryBin(stack); @@ -358,12 +358,12 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem { if(Block.getBlockFromItem(this) == MekanismBlocks.BasicBlock2 && itemStack.getItemDamage() == 3) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return 0; } - return itemStack.stackTagCompound.getDouble("energyStored"); + return itemStack.getTagCompound().getDouble("energyStored"); } return 0; @@ -374,12 +374,12 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem { if(Block.getBlockFromItem(this) == MekanismBlocks.BasicBlock2 && itemStack.getItemDamage() == 3) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.stackTagCompound.setDouble("energyStored", Math.max(Math.min(amount, getMaxEnergy(itemStack)), 0)); + itemStack.getTagCompound().setDouble("energyStored", Math.max(Math.min(amount, getMaxEnergy(itemStack)), 0)); } } diff --git a/src/main/java/mekanism/common/item/ItemBlockCardboardBox.java b/src/main/java/mekanism/common/item/ItemBlockCardboardBox.java index b17ef258d..2e546039e 100644 --- a/src/main/java/mekanism/common/item/ItemBlockCardboardBox.java +++ b/src/main/java/mekanism/common/item/ItemBlockCardboardBox.java @@ -142,22 +142,22 @@ public class ItemBlockCardboardBox extends ItemBlock public void setBlockData(ItemStack itemstack, BlockData data) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { itemstack.setTagCompound(new NBTTagCompound()); } - itemstack.stackTagCompound.setTag("blockData", data.write(new NBTTagCompound())); + itemstack.getTagCompound().setTag("blockData", data.write(new NBTTagCompound())); } public BlockData getBlockData(ItemStack itemstack) { - if(itemstack.stackTagCompound == null || !itemstack.stackTagCompound.hasKey("blockData")) + if(itemstack.getTagCompound() == null || !itemstack.getTagCompound().hasKey("blockData")) { return null; } - return BlockData.read(itemstack.stackTagCompound.getCompoundTag("blockData")); + return BlockData.read(itemstack.getTagCompound().getCompoundTag("blockData")); } @SubscribeEvent diff --git a/src/main/java/mekanism/common/item/ItemBlockEnergyCube.java b/src/main/java/mekanism/common/item/ItemBlockEnergyCube.java index c0e5feb2b..2a6685e61 100644 --- a/src/main/java/mekanism/common/item/ItemBlockEnergyCube.java +++ b/src/main/java/mekanism/common/item/ItemBlockEnergyCube.java @@ -110,28 +110,28 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IE @Override public EnergyCubeTier getEnergyCubeTier(ItemStack itemstack) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { return EnergyCubeTier.BASIC; } - if(itemstack.stackTagCompound.getString("tier") == null) + if(itemstack.getTagCompound().getString("tier") == null) { return EnergyCubeTier.BASIC; } - return EnergyCubeTier.getFromName(itemstack.stackTagCompound.getString("tier")); + return EnergyCubeTier.getFromName(itemstack.getTagCompound().getString("tier")); } @Override public void setEnergyCubeTier(ItemStack itemstack, EnergyCubeTier tier) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { itemstack.setTagCompound(new NBTTagCompound()); } - itemstack.stackTagCompound.setString("tier", tier.getBaseTier().getName()); + itemstack.getTagCompound().setString("tier", tier.getBaseTier().getName()); } @Override @@ -169,12 +169,12 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IE { ItemStack itemStack = (ItemStack)data[0]; - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.stackTagCompound.setTag("Items", nbtTags); + itemStack.getTagCompound().setTag("Items", nbtTags); } } @@ -185,12 +185,12 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IE { ItemStack itemStack = (ItemStack)data[0]; - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return null; } - return itemStack.stackTagCompound.getTagList("Items", NBT.TAG_COMPOUND); + return itemStack.getTagCompound().getTagList("Items", NBT.TAG_COMPOUND); } return null; @@ -199,12 +199,12 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IE @Override public double getEnergy(ItemStack itemStack) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return 0; } - double electricityStored = itemStack.stackTagCompound.getDouble("electricity"); + double electricityStored = itemStack.getTagCompound().getDouble("electricity"); itemStack.setItemDamage((int)Math.max(1, (Math.abs(((electricityStored/getMaxEnergy(itemStack))*100)-100)))); return electricityStored; @@ -218,13 +218,13 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IE return; } - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } double electricityStored = Math.max(Math.min(amount, getMaxEnergy(itemStack)), 0); - itemStack.stackTagCompound.setDouble("electricity", electricityStored); + itemStack.getTagCompound().setDouble("electricity", electricityStored); itemStack.setItemDamage((int)Math.max(1, (Math.abs(((electricityStored/getMaxEnergy(itemStack))*100)-100)))); } diff --git a/src/main/java/mekanism/common/item/ItemBlockGasTank.java b/src/main/java/mekanism/common/item/ItemBlockGasTank.java index e7b8629c2..14c70579c 100644 --- a/src/main/java/mekanism/common/item/ItemBlockGasTank.java +++ b/src/main/java/mekanism/common/item/ItemBlockGasTank.java @@ -112,12 +112,12 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI @Override public GasStack getGas(ItemStack itemstack) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { return null; } - GasStack stored = GasStack.readFromNBT(itemstack.stackTagCompound.getCompoundTag("stored")); + GasStack stored = GasStack.readFromNBT(itemstack.getTagCompound().getCompoundTag("stored")); if(stored == null) { @@ -133,7 +133,7 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI @Override public void setGas(ItemStack itemstack, GasStack stack) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { itemstack.setTagCompound(new NBTTagCompound()); } @@ -141,14 +141,14 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI if(stack == null || stack.amount == 0) { itemstack.setItemDamage(100); - itemstack.stackTagCompound.removeTag("stored"); + itemstack.getTagCompound().removeTag("stored"); } else { int amount = Math.max(0, Math.min(stack.amount, getMaxGas(itemstack))); GasStack gasStack = new GasStack(stack.getGas(), amount); itemstack.setItemDamage((int)Math.max(1, (Math.abs((((float)amount/getMaxGas(itemstack))*100)-100)))); - itemstack.stackTagCompound.setTag("stored", gasStack.write(new NBTTagCompound())); + itemstack.getTagCompound().setTag("stored", gasStack.write(new NBTTagCompound())); } } @@ -245,12 +245,12 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI { ItemStack itemStack = (ItemStack)data[0]; - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.stackTagCompound.setTag("Items", nbtTags); + itemStack.getTagCompound().setTag("Items", nbtTags); } } @@ -261,12 +261,12 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI { ItemStack itemStack = (ItemStack)data[0]; - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return null; } - return itemStack.stackTagCompound.getTagList("Items", NBT.TAG_COMPOUND); + return itemStack.getTagCompound().getTagList("Items", NBT.TAG_COMPOUND); } return null; diff --git a/src/main/java/mekanism/common/item/ItemBlockMachine.java b/src/main/java/mekanism/common/item/ItemBlockMachine.java index 288367a87..832c2d1f9 100644 --- a/src/main/java/mekanism/common/item/ItemBlockMachine.java +++ b/src/main/java/mekanism/common/item/ItemBlockMachine.java @@ -210,9 +210,9 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec list.add(EnumColor.AQUA + LangUtils.localize("tooltip.inventory") + ": " + EnumColor.GREY + LangUtils.transYesNo(getInventory(itemstack) != null && getInventory(itemstack).tagCount() != 0)); } - if(type.supportsUpgrades && itemstack.stackTagCompound != null && itemstack.stackTagCompound.hasKey("upgrades")) + if(type.supportsUpgrades && itemstack.getTagCompound() != null && itemstack.getTagCompound().hasKey("upgrades")) { - Map upgrades = Upgrade.buildMap(itemstack.stackTagCompound); + Map upgrades = Upgrade.buildMap(itemstack.getTagCompound()); for(Map.Entry entry : upgrades.entrySet()) { @@ -277,9 +277,9 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec if(tileEntity instanceof IUpgradeTile) { - if(stack.stackTagCompound != null && stack.stackTagCompound.hasKey("upgrades")) + if(stack.getTagCompound() != null && stack.getTagCompound().hasKey("upgrades")) { - ((IUpgradeTile)tileEntity).getComponent().read(stack.stackTagCompound); + ((IUpgradeTile)tileEntity).getComponent().read(stack.getTagCompound()); } } @@ -287,15 +287,15 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec { ISideConfiguration config = (ISideConfiguration)tileEntity; - if(stack.stackTagCompound != null && stack.stackTagCompound.hasKey("sideDataStored")) + if(stack.getTagCompound() != null && stack.getTagCompound().hasKey("sideDataStored")) { - config.getConfig().read(stack.stackTagCompound); + config.getConfig().read(stack.getTagCompound()); } } if(tileEntity instanceof ISustainedData) { - if(stack.stackTagCompound != null) + if(stack.getTagCompound() != null) { ((ISustainedData)tileEntity).readSustainedData(stack); } @@ -303,9 +303,9 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec if(tileEntity instanceof IRedstoneControl) { - if(stack.stackTagCompound != null && stack.stackTagCompound.hasKey("controlType")) + if(stack.getTagCompound() != null && stack.getTagCompound().hasKey("controlType")) { - ((IRedstoneControl)tileEntity).setControlType(RedstoneControl.values()[stack.stackTagCompound.getInteger("controlType")]); + ((IRedstoneControl)tileEntity).setControlType(RedstoneControl.values()[stack.getTagCompound().getInteger("controlType")]); } } @@ -597,23 +597,23 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec @Override public int getRecipeType(ItemStack itemStack) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return 0; } - return itemStack.stackTagCompound.getInteger("recipeType"); + return itemStack.getTagCompound().getInteger("recipeType"); } @Override public void setRecipeType(int type, ItemStack itemStack) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.stackTagCompound.setInteger("recipeType", type); + itemStack.getTagCompound().setInteger("recipeType", type); } @Override @@ -623,12 +623,12 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec { ItemStack itemStack = (ItemStack)data[0]; - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.stackTagCompound.setTag("Items", nbtTags); + itemStack.getTagCompound().setTag("Items", nbtTags); } } @@ -639,12 +639,12 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec { ItemStack itemStack = (ItemStack)data[0]; - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return null; } - return itemStack.stackTagCompound.getTagList("Items", NBT.TAG_COMPOUND); + return itemStack.getTagCompound().getTagList("Items", NBT.TAG_COMPOUND); } return null; @@ -657,17 +657,17 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec { ItemStack itemStack = (ItemStack)data[0]; - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } if(fluidStack == null || fluidStack.amount == 0 || fluidStack.getFluidID() == 0) { - itemStack.stackTagCompound.removeTag("fluidTank"); + itemStack.getTagCompound().removeTag("fluidTank"); } else { - itemStack.stackTagCompound.setTag("fluidTank", fluidStack.writeToNBT(new NBTTagCompound())); + itemStack.getTagCompound().setTag("fluidTank", fluidStack.writeToNBT(new NBTTagCompound())); } } } @@ -679,14 +679,14 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec { ItemStack itemStack = (ItemStack)data[0]; - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return null; } - if(itemStack.stackTagCompound.hasKey("fluidTank")) + if(itemStack.getTagCompound().hasKey("fluidTank")) { - return FluidStack.loadFluidStackFromNBT(itemStack.stackTagCompound.getCompoundTag("fluidTank")); + return FluidStack.loadFluidStackFromNBT(itemStack.getTagCompound().getCompoundTag("fluidTank")); } } @@ -709,140 +709,140 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec @Override public void setAuthenticated(ItemStack itemStack, boolean auth) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.stackTagCompound.setBoolean("authenticated", auth); + itemStack.getTagCompound().setBoolean("authenticated", auth); } @Override public boolean getAuthenticated(ItemStack itemStack) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return false; } - return itemStack.stackTagCompound.getBoolean("authenticated"); + return itemStack.getTagCompound().getBoolean("authenticated"); } @Override public void setPassword(ItemStack itemStack, String pass) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.stackTagCompound.setString("password", pass); + itemStack.getTagCompound().setString("password", pass); } @Override public String getPassword(ItemStack itemStack) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return ""; } - return itemStack.stackTagCompound.getString("password"); + return itemStack.getTagCompound().getString("password"); } @Override public void setLocked(ItemStack itemStack, boolean locked) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.stackTagCompound.setBoolean("locked", locked); + itemStack.getTagCompound().setBoolean("locked", locked); } @Override public boolean getLocked(ItemStack itemStack) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return false; } - return itemStack.stackTagCompound.getBoolean("locked"); + return itemStack.getTagCompound().getBoolean("locked"); } @Override public void setOpen(ItemStack itemStack, boolean open) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.stackTagCompound.setBoolean("open", open); + itemStack.getTagCompound().setBoolean("open", open); } @Override public boolean getOpen(ItemStack itemStack) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return false; } - return itemStack.stackTagCompound.getBoolean("open"); + return itemStack.getTagCompound().getBoolean("open"); } public void setPrevScale(ItemStack itemStack, float prevLidAngle) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.stackTagCompound.setFloat("prevScale", prevLidAngle); + itemStack.getTagCompound().setFloat("prevScale", prevLidAngle); } public float getPrevScale(ItemStack itemStack) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return 0.0F; } - return itemStack.stackTagCompound.getFloat("prevScale"); + return itemStack.getTagCompound().getFloat("prevScale"); } public void setBucketMode(ItemStack itemStack, boolean bucketMode) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.stackTagCompound.setBoolean("bucketMode", bucketMode); + itemStack.getTagCompound().setBoolean("bucketMode", bucketMode); } public boolean getBucketMode(ItemStack itemStack) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return false; } - return itemStack.stackTagCompound.getBoolean("bucketMode"); + return itemStack.getTagCompound().getBoolean("bucketMode"); } @Override public double getEnergy(ItemStack itemStack) { - if(itemStack.stackTagCompound == null || !MachineType.get(itemStack).isElectric) + if(itemStack.getTagCompound() == null || !MachineType.get(itemStack).isElectric) { return 0; } - return itemStack.stackTagCompound.getDouble("electricity"); + return itemStack.getTagCompound().getDouble("electricity"); } @Override @@ -853,13 +853,13 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec return; } - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } double electricityStored = Math.max(Math.min(amount, getMaxEnergy(itemStack)), 0); - itemStack.stackTagCompound.setDouble("electricity", electricityStored); + itemStack.getTagCompound().setDouble("electricity", electricityStored); } @Override diff --git a/src/main/java/mekanism/common/item/ItemConfigurator.java b/src/main/java/mekanism/common/item/ItemConfigurator.java index 7b8e6968f..c993c8670 100644 --- a/src/main/java/mekanism/common/item/ItemConfigurator.java +++ b/src/main/java/mekanism/common/item/ItemConfigurator.java @@ -220,24 +220,24 @@ public class ItemConfigurator extends ItemEnergized implements IMekWrench, ITool public void setState(ItemStack itemstack, ConfiguratorMode state) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { itemstack.setTagCompound(new NBTTagCompound()); } - itemstack.stackTagCompound.setInteger("state", state.ordinal()); + itemstack.getTagCompound().setInteger("state", state.ordinal()); } public ConfiguratorMode getState(ItemStack itemstack) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { return ConfiguratorMode.CONFIGURATE_ITEMS; } - if(itemstack.stackTagCompound.getTag("state") != null) + if(itemstack.getTagCompound().getTag("state") != null) { - return ConfiguratorMode.values()[itemstack.stackTagCompound.getInteger("state")]; + return ConfiguratorMode.values()[itemstack.getTagCompound().getInteger("state")]; } return ConfiguratorMode.CONFIGURATE_ITEMS; diff --git a/src/main/java/mekanism/common/item/ItemElectricBow.java b/src/main/java/mekanism/common/item/ItemElectricBow.java index 1a30b9acc..717b41f61 100644 --- a/src/main/java/mekanism/common/item/ItemElectricBow.java +++ b/src/main/java/mekanism/common/item/ItemElectricBow.java @@ -114,12 +114,12 @@ public class ItemElectricBow extends ItemEnergized */ public void setFireState(ItemStack itemstack, boolean state) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { itemstack.setTagCompound(new NBTTagCompound()); } - itemstack.stackTagCompound.setBoolean("fireState", state); + itemstack.getTagCompound().setBoolean("fireState", state); } /** @@ -129,16 +129,16 @@ public class ItemElectricBow extends ItemEnergized */ public boolean getFireState(ItemStack itemstack) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { return false; } boolean state = false; - if(itemstack.stackTagCompound.getTag("fireState") != null) + if(itemstack.getTagCompound().getTag("fireState") != null) { - state = itemstack.stackTagCompound.getBoolean("fireState"); + state = itemstack.getTagCompound().getBoolean("fireState"); } return state; diff --git a/src/main/java/mekanism/common/item/ItemEnergized.java b/src/main/java/mekanism/common/item/ItemEnergized.java index 637cb211e..768328d24 100644 --- a/src/main/java/mekanism/common/item/ItemEnergized.java +++ b/src/main/java/mekanism/common/item/ItemEnergized.java @@ -109,12 +109,12 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, ISpec @Override public double getEnergy(ItemStack itemStack) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return 0; } - double electricityStored = itemStack.stackTagCompound.getDouble("electricity"); + double electricityStored = itemStack.getTagCompound().getDouble("electricity"); itemStack.setItemDamage((int)Math.max(1, (Math.abs(((electricityStored/getMaxEnergy(itemStack))*100)-100)))); return electricityStored; @@ -123,13 +123,13 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, ISpec @Override public void setEnergy(ItemStack itemStack, double amount) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } double electricityStored = Math.max(Math.min(amount, getMaxEnergy(itemStack)), 0); - itemStack.stackTagCompound.setDouble("electricity", electricityStored); + itemStack.getTagCompound().setDouble("electricity", electricityStored); itemStack.setItemDamage((int)Math.max(1, (Math.abs(((electricityStored/getMaxEnergy(itemStack))*100)-100)))); } diff --git a/src/main/java/mekanism/common/item/ItemFilterCard.java b/src/main/java/mekanism/common/item/ItemFilterCard.java index 4579e3cb3..88abe5174 100644 --- a/src/main/java/mekanism/common/item/ItemFilterCard.java +++ b/src/main/java/mekanism/common/item/ItemFilterCard.java @@ -73,35 +73,35 @@ public class ItemFilterCard extends ItemMekanism public void setData(ItemStack itemstack, NBTTagCompound data) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { itemstack.setTagCompound(new NBTTagCompound()); } if(data != null) { - itemstack.stackTagCompound.setTag("data", data); + itemstack.getTagCompound().setTag("data", data); } else { - itemstack.stackTagCompound.removeTag("data"); + itemstack.getTagCompound().removeTag("data"); } } public NBTTagCompound getData(ItemStack itemstack) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { return null; } - NBTTagCompound data = itemstack.stackTagCompound.getCompoundTag("data"); + NBTTagCompound data = itemstack.getTagCompound().getCompoundTag("data"); if(data.hasNoTags()) { return null; } else { - return itemstack.stackTagCompound.getCompoundTag("data"); + return itemstack.getTagCompound().getCompoundTag("data"); } } diff --git a/src/main/java/mekanism/common/item/ItemFlamethrower.java b/src/main/java/mekanism/common/item/ItemFlamethrower.java index f9e7e3131..a32455606 100644 --- a/src/main/java/mekanism/common/item/ItemFlamethrower.java +++ b/src/main/java/mekanism/common/item/ItemFlamethrower.java @@ -112,12 +112,12 @@ public class ItemFlamethrower extends ItemMekanism implements IGasItem @Override public GasStack getGas(ItemStack itemstack) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { return null; } - GasStack stored = GasStack.readFromNBT(itemstack.stackTagCompound.getCompoundTag("stored")); + GasStack stored = GasStack.readFromNBT(itemstack.getTagCompound().getCompoundTag("stored")); if(stored == null) { @@ -139,7 +139,7 @@ public class ItemFlamethrower extends ItemMekanism implements IGasItem @Override public void setGas(ItemStack itemstack, GasStack stack) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { itemstack.setTagCompound(new NBTTagCompound()); } @@ -147,14 +147,14 @@ public class ItemFlamethrower extends ItemMekanism implements IGasItem if(stack == null || stack.amount == 0) { itemstack.setItemDamage(100); - itemstack.stackTagCompound.removeTag("stored"); + itemstack.getTagCompound().removeTag("stored"); } else { int amount = Math.max(0, Math.min(stack.amount, getMaxGas(itemstack))); GasStack gasStack = new GasStack(stack.getGas(), amount); itemstack.setItemDamage((int)Math.max(1, (Math.abs((((float)amount/getMaxGas(itemstack))*100)-100)))); - itemstack.stackTagCompound.setTag("stored", gasStack.write(new NBTTagCompound())); + itemstack.getTagCompound().setTag("stored", gasStack.write(new NBTTagCompound())); } } @@ -186,22 +186,22 @@ public class ItemFlamethrower extends ItemMekanism implements IGasItem public FlamethrowerMode getMode(ItemStack stack) { - if(stack.stackTagCompound == null) + if(stack.getTagCompound() == null) { return FlamethrowerMode.COMBAT; } - return FlamethrowerMode.values()[stack.stackTagCompound.getInteger("mode")]; + return FlamethrowerMode.values()[stack.getTagCompound().getInteger("mode")]; } public void setMode(ItemStack stack, FlamethrowerMode mode) { - if(stack.stackTagCompound == null) + if(stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - stack.stackTagCompound.setInteger("mode", mode.ordinal()); + stack.getTagCompound().setInteger("mode", mode.ordinal()); } public static enum FlamethrowerMode diff --git a/src/main/java/mekanism/common/item/ItemFreeRunners.java b/src/main/java/mekanism/common/item/ItemFreeRunners.java index 623c73f47..165c978c5 100644 --- a/src/main/java/mekanism/common/item/ItemFreeRunners.java +++ b/src/main/java/mekanism/common/item/ItemFreeRunners.java @@ -146,12 +146,12 @@ public class ItemFreeRunners extends ItemArmor implements IEnergizedItem, ISpeci @Override public double getEnergy(ItemStack itemStack) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return 0; } - double electricityStored = itemStack.stackTagCompound.getDouble("electricity"); + double electricityStored = itemStack.getTagCompound().getDouble("electricity"); itemStack.setItemDamage((int)Math.max(1, (Math.abs(((electricityStored/getMaxEnergy(itemStack))*100)-100)))); return electricityStored; @@ -160,13 +160,13 @@ public class ItemFreeRunners extends ItemArmor implements IEnergizedItem, ISpeci @Override public void setEnergy(ItemStack itemStack, double amount) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } double electricityStored = Math.max(Math.min(amount, getMaxEnergy(itemStack)), 0); - itemStack.stackTagCompound.setDouble("electricity", electricityStored); + itemStack.getTagCompound().setDouble("electricity", electricityStored); itemStack.setItemDamage((int)Math.max(1, (Math.abs(((electricityStored/getMaxEnergy(itemStack))*100)-100)))); } diff --git a/src/main/java/mekanism/common/item/ItemGaugeDropper.java b/src/main/java/mekanism/common/item/ItemGaugeDropper.java index 7a1a8be6c..d3878c8a3 100644 --- a/src/main/java/mekanism/common/item/ItemGaugeDropper.java +++ b/src/main/java/mekanism/common/item/ItemGaugeDropper.java @@ -103,14 +103,14 @@ public class ItemGaugeDropper extends ItemMekanism implements IGasItem, IFluidCo private FluidStack getFluid_do(ItemStack container) { - if(container.stackTagCompound == null) + if(container.getTagCompound() == null) { return null; } - if(container.stackTagCompound.hasKey("fluidStack")) + if(container.getTagCompound().hasKey("fluidStack")) { - return FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("fluidStack")); + return FluidStack.loadFluidStackFromNBT(container.getTagCompound().getCompoundTag("fluidStack")); } return null; @@ -125,17 +125,17 @@ public class ItemGaugeDropper extends ItemMekanism implements IGasItem, IFluidCo public void setFluid(ItemStack container, FluidStack stack) { - if(container.stackTagCompound == null) + if(container.getTagCompound() == null) { container.setTagCompound(new NBTTagCompound()); } if(stack == null || stack.amount == 0 || stack.getFluidID() == 0) { - container.stackTagCompound.removeTag("fluidStack"); + container.getTagCompound().removeTag("fluidStack"); } else { - container.stackTagCompound.setTag("fluidStack", stack.writeToNBT(new NBTTagCompound())); + container.getTagCompound().setTag("fluidStack", stack.writeToNBT(new NBTTagCompound())); } updateDamage(container); @@ -251,12 +251,12 @@ public class ItemGaugeDropper extends ItemMekanism implements IGasItem, IFluidCo private GasStack getGas_do(ItemStack itemstack) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { return null; } - return GasStack.readFromNBT(itemstack.stackTagCompound.getCompoundTag("gasStack")); + return GasStack.readFromNBT(itemstack.getTagCompound().getCompoundTag("gasStack")); } @Override @@ -269,20 +269,20 @@ public class ItemGaugeDropper extends ItemMekanism implements IGasItem, IFluidCo @Override public void setGas(ItemStack itemstack, GasStack stack) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { itemstack.setTagCompound(new NBTTagCompound()); } if(stack == null || stack.amount == 0) { - itemstack.stackTagCompound.removeTag("gasStack"); + itemstack.getTagCompound().removeTag("gasStack"); } else { int amount = Math.max(0, Math.min(stack.amount, getMaxGas(itemstack))); GasStack gasStack = new GasStack(stack.getGas(), amount); - itemstack.stackTagCompound.setTag("gasStack", gasStack.write(new NBTTagCompound())); + itemstack.getTagCompound().setTag("gasStack", gasStack.write(new NBTTagCompound())); } updateDamage(itemstack); diff --git a/src/main/java/mekanism/common/item/ItemJetpack.java b/src/main/java/mekanism/common/item/ItemJetpack.java index f2ef481a6..56ba24bad 100644 --- a/src/main/java/mekanism/common/item/ItemJetpack.java +++ b/src/main/java/mekanism/common/item/ItemJetpack.java @@ -158,12 +158,12 @@ public class ItemJetpack extends ItemArmor implements IGasItem, ISpecialArmor @Override public GasStack getGas(ItemStack itemstack) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { return null; } - GasStack stored = GasStack.readFromNBT(itemstack.stackTagCompound.getCompoundTag("stored")); + GasStack stored = GasStack.readFromNBT(itemstack.getTagCompound().getCompoundTag("stored")); if(stored == null) { @@ -184,28 +184,28 @@ public class ItemJetpack extends ItemArmor implements IGasItem, ISpecialArmor public JetpackMode getMode(ItemStack stack) { - if(stack.stackTagCompound == null) + if(stack.getTagCompound() == null) { return JetpackMode.NORMAL; } - return JetpackMode.values()[stack.stackTagCompound.getInteger("mode")]; + return JetpackMode.values()[stack.getTagCompound().getInteger("mode")]; } public void setMode(ItemStack stack, JetpackMode mode) { - if(stack.stackTagCompound == null) + if(stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - stack.stackTagCompound.setInteger("mode", mode.ordinal()); + stack.getTagCompound().setInteger("mode", mode.ordinal()); } @Override public void setGas(ItemStack itemstack, GasStack stack) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { itemstack.setTagCompound(new NBTTagCompound()); } @@ -213,14 +213,14 @@ public class ItemJetpack extends ItemArmor implements IGasItem, ISpecialArmor if(stack == null || stack.amount == 0) { itemstack.setItemDamage(100); - itemstack.stackTagCompound.removeTag("stored"); + itemstack.getTagCompound().removeTag("stored"); } else { int amount = Math.max(0, Math.min(stack.amount, getMaxGas(itemstack))); GasStack gasStack = new GasStack(stack.getGas(), amount); itemstack.setItemDamage((int)Math.max(1, (Math.abs((((float)amount/getMaxGas(itemstack))*100)-100)))); - itemstack.stackTagCompound.setTag("stored", gasStack.write(new NBTTagCompound())); + itemstack.getTagCompound().setTag("stored", gasStack.write(new NBTTagCompound())); } } diff --git a/src/main/java/mekanism/common/item/ItemProxy.java b/src/main/java/mekanism/common/item/ItemProxy.java index afa8dbda8..58d9aec64 100644 --- a/src/main/java/mekanism/common/item/ItemProxy.java +++ b/src/main/java/mekanism/common/item/ItemProxy.java @@ -25,7 +25,7 @@ public class ItemProxy extends Item @Override public boolean doesContainerItemLeaveCraftingGrid(ItemStack stack) { - return stack.stackTagCompound == null || !stack.stackTagCompound.getBoolean("hasStack"); + return stack.getTagCompound() == null || !stack.getTagCompound().getBoolean("hasStack"); } @Override @@ -36,32 +36,32 @@ public class ItemProxy extends Item public void setSavedItem(ItemStack stack, ItemStack save) { - if(stack.stackTagCompound == null) + if(stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } if(save == null) { - stack.stackTagCompound.setBoolean("hasStack", false); - stack.stackTagCompound.removeTag("savedItem"); + stack.getTagCompound().setBoolean("hasStack", false); + stack.getTagCompound().removeTag("savedItem"); } else { - stack.stackTagCompound.setBoolean("hasStack", true); - stack.stackTagCompound.setTag("savedItem", save.writeToNBT(new NBTTagCompound())); + stack.getTagCompound().setBoolean("hasStack", true); + stack.getTagCompound().setTag("savedItem", save.writeToNBT(new NBTTagCompound())); } } public ItemStack getSavedItem(ItemStack stack) { - if(stack.stackTagCompound == null) + if(stack.getTagCompound() == null) { return null; } - if(stack.stackTagCompound.getBoolean("hasStack")) + if(stack.getTagCompound().getBoolean("hasStack")) { - return ItemStack.loadItemStackFromNBT(stack.stackTagCompound.getCompoundTag("savedItem")); + return ItemStack.loadItemStackFromNBT(stack.getTagCompound().getCompoundTag("savedItem")); } return null; diff --git a/src/main/java/mekanism/common/item/ItemRobit.java b/src/main/java/mekanism/common/item/ItemRobit.java index c552d0dbd..0a76c181b 100644 --- a/src/main/java/mekanism/common/item/ItemRobit.java +++ b/src/main/java/mekanism/common/item/ItemRobit.java @@ -79,22 +79,22 @@ public class ItemRobit extends ItemEnergized implements ISustainedInventory public void setName(ItemStack itemstack, String name) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { itemstack.setTagCompound(new NBTTagCompound()); } - itemstack.stackTagCompound.setString("name", name); + itemstack.getTagCompound().setString("name", name); } public String getName(ItemStack itemstack) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { return "Robit"; } - String name = itemstack.stackTagCompound.getString("name"); + String name = itemstack.getTagCompound().getString("name"); return name.equals("") ? "Robit" : name; } @@ -106,12 +106,12 @@ public class ItemRobit extends ItemEnergized implements ISustainedInventory { ItemStack itemStack = (ItemStack)data[0]; - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.stackTagCompound.setTag("Items", nbtTags); + itemStack.getTagCompound().setTag("Items", nbtTags); } } @@ -122,12 +122,12 @@ public class ItemRobit extends ItemEnergized implements ISustainedInventory { ItemStack itemStack = (ItemStack)data[0]; - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return null; } - return itemStack.stackTagCompound.getTagList("Items", 10); + return itemStack.getTagCompound().getTagList("Items", 10); } return null; diff --git a/src/main/java/mekanism/common/item/ItemScubaTank.java b/src/main/java/mekanism/common/item/ItemScubaTank.java index 88c0e045f..e6c4edd48 100644 --- a/src/main/java/mekanism/common/item/ItemScubaTank.java +++ b/src/main/java/mekanism/common/item/ItemScubaTank.java @@ -144,12 +144,12 @@ public class ItemScubaTank extends ItemArmor implements IGasItem public boolean getFlowing(ItemStack stack) { - if(stack.stackTagCompound == null) + if(stack.getTagCompound() == null) { return false; } - return stack.stackTagCompound.getBoolean("flowing"); + return stack.getTagCompound().getBoolean("flowing"); } public String getFlowingStr(ItemStack stack) @@ -161,12 +161,12 @@ public class ItemScubaTank extends ItemArmor implements IGasItem public void setFlowing(ItemStack stack, boolean flowing) { - if(stack.stackTagCompound == null) + if(stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); } - stack.stackTagCompound.setBoolean("flowing", flowing); + stack.getTagCompound().setBoolean("flowing", flowing); } @Override @@ -184,12 +184,12 @@ public class ItemScubaTank extends ItemArmor implements IGasItem @Override public GasStack getGas(ItemStack itemstack) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { return null; } - GasStack stored = GasStack.readFromNBT(itemstack.stackTagCompound.getCompoundTag("stored")); + GasStack stored = GasStack.readFromNBT(itemstack.getTagCompound().getCompoundTag("stored")); if(stored == null) { @@ -205,7 +205,7 @@ public class ItemScubaTank extends ItemArmor implements IGasItem @Override public void setGas(ItemStack itemstack, GasStack stack) { - if(itemstack.stackTagCompound == null) + if(itemstack.getTagCompound() == null) { itemstack.setTagCompound(new NBTTagCompound()); } @@ -213,14 +213,14 @@ public class ItemScubaTank extends ItemArmor implements IGasItem if(stack == null || stack.amount == 0) { itemstack.setItemDamage(100); - itemstack.stackTagCompound.removeTag("stored"); + itemstack.getTagCompound().removeTag("stored"); } else { int amount = Math.max(0, Math.min(stack.amount, getMaxGas(itemstack))); GasStack gasStack = new GasStack(stack.getGas(), amount); itemstack.setItemDamage((int)Math.max(1, (Math.abs((((float)amount/getMaxGas(itemstack))*100)-100)))); - itemstack.stackTagCompound.setTag("stored", gasStack.write(new NBTTagCompound())); + itemstack.getTagCompound().setTag("stored", gasStack.write(new NBTTagCompound())); } } diff --git a/src/main/java/mekanism/common/item/ItemWalkieTalkie.java b/src/main/java/mekanism/common/item/ItemWalkieTalkie.java index 08110cd29..baa68eacd 100644 --- a/src/main/java/mekanism/common/item/ItemWalkieTalkie.java +++ b/src/main/java/mekanism/common/item/ItemWalkieTalkie.java @@ -65,48 +65,48 @@ public class ItemWalkieTalkie extends ItemMekanism public void setOn(ItemStack itemStack, boolean on) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.stackTagCompound.setBoolean("on", on); + itemStack.getTagCompound().setBoolean("on", on); } public boolean getOn(ItemStack itemStack) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return false; } - return itemStack.stackTagCompound.getBoolean("on"); + return itemStack.getTagCompound().getBoolean("on"); } public void setChannel(ItemStack itemStack, int channel) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } - itemStack.stackTagCompound.setInteger("channel", channel); + itemStack.getTagCompound().setInteger("channel", channel); } public int getChannel(ItemStack itemStack) { - if(itemStack.stackTagCompound == null) + if(itemStack.getTagCompound() == null) { return 1; } - int channel = itemStack.stackTagCompound.getInteger("channel"); + int channel = itemStack.getTagCompound().getInteger("channel"); if(channel == 0) { setChannel(itemStack, 1); } - return itemStack.stackTagCompound.getInteger("channel"); + return itemStack.getTagCompound().getInteger("channel"); } } diff --git a/src/main/java/mekanism/common/tile/TileEntityChemicalCrystallizer.java b/src/main/java/mekanism/common/tile/TileEntityChemicalCrystallizer.java index 16b9116cd..fc9c3e55d 100644 --- a/src/main/java/mekanism/common/tile/TileEntityChemicalCrystallizer.java +++ b/src/main/java/mekanism/common/tile/TileEntityChemicalCrystallizer.java @@ -438,14 +438,14 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock { if(inputTank.getGas() != null) { - itemStack.stackTagCompound.setTag("inputTank", inputTank.getGas().write(new NBTTagCompound())); + itemStack.getTagCompound().setTag("inputTank", inputTank.getGas().write(new NBTTagCompound())); } } @Override public void readSustainedData(ItemStack itemStack) { - inputTank.setGas(GasStack.readFromNBT(itemStack.stackTagCompound.getCompoundTag("inputTank"))); + inputTank.setGas(GasStack.readFromNBT(itemStack.getTagCompound().getCompoundTag("inputTank"))); } @Override diff --git a/src/main/java/mekanism/common/tile/TileEntityChemicalDissolutionChamber.java b/src/main/java/mekanism/common/tile/TileEntityChemicalDissolutionChamber.java index 3afb9ea7c..e80af4f2b 100644 --- a/src/main/java/mekanism/common/tile/TileEntityChemicalDissolutionChamber.java +++ b/src/main/java/mekanism/common/tile/TileEntityChemicalDissolutionChamber.java @@ -456,20 +456,20 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri { if(injectTank.getGas() != null) { - itemStack.stackTagCompound.setTag("injectTank", injectTank.getGas().write(new NBTTagCompound())); + itemStack.getTagCompound().setTag("injectTank", injectTank.getGas().write(new NBTTagCompound())); } if(outputTank.getGas() != null) { - itemStack.stackTagCompound.setTag("outputTank", outputTank.getGas().write(new NBTTagCompound())); + itemStack.getTagCompound().setTag("outputTank", outputTank.getGas().write(new NBTTagCompound())); } } @Override public void readSustainedData(ItemStack itemStack) { - injectTank.setGas(GasStack.readFromNBT(itemStack.stackTagCompound.getCompoundTag("injectTank"))); - outputTank.setGas(GasStack.readFromNBT(itemStack.stackTagCompound.getCompoundTag("outputTank"))); + injectTank.setGas(GasStack.readFromNBT(itemStack.getTagCompound().getCompoundTag("injectTank"))); + outputTank.setGas(GasStack.readFromNBT(itemStack.getTagCompound().getCompoundTag("outputTank"))); } @Override diff --git a/src/main/java/mekanism/common/tile/TileEntityChemicalInfuser.java b/src/main/java/mekanism/common/tile/TileEntityChemicalInfuser.java index a2ba1d690..482dcf514 100644 --- a/src/main/java/mekanism/common/tile/TileEntityChemicalInfuser.java +++ b/src/main/java/mekanism/common/tile/TileEntityChemicalInfuser.java @@ -501,26 +501,26 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl { if(leftTank.getGas() != null) { - itemStack.stackTagCompound.setTag("leftTank", leftTank.getGas().write(new NBTTagCompound())); + itemStack.getTagCompound().setTag("leftTank", leftTank.getGas().write(new NBTTagCompound())); } if(rightTank.getGas() != null) { - itemStack.stackTagCompound.setTag("rightTank", rightTank.getGas().write(new NBTTagCompound())); + itemStack.getTagCompound().setTag("rightTank", rightTank.getGas().write(new NBTTagCompound())); } if(centerTank.getGas() != null) { - itemStack.stackTagCompound.setTag("centerTank", centerTank.getGas().write(new NBTTagCompound())); + itemStack.getTagCompound().setTag("centerTank", centerTank.getGas().write(new NBTTagCompound())); } } @Override public void readSustainedData(ItemStack itemStack) { - leftTank.setGas(GasStack.readFromNBT(itemStack.stackTagCompound.getCompoundTag("leftTank"))); - rightTank.setGas(GasStack.readFromNBT(itemStack.stackTagCompound.getCompoundTag("rightTank"))); - centerTank.setGas(GasStack.readFromNBT(itemStack.stackTagCompound.getCompoundTag("centerTank"))); + leftTank.setGas(GasStack.readFromNBT(itemStack.getTagCompound().getCompoundTag("leftTank"))); + rightTank.setGas(GasStack.readFromNBT(itemStack.getTagCompound().getCompoundTag("rightTank"))); + centerTank.setGas(GasStack.readFromNBT(itemStack.getTagCompound().getCompoundTag("centerTank"))); } @Override diff --git a/src/main/java/mekanism/common/tile/TileEntityChemicalOxidizer.java b/src/main/java/mekanism/common/tile/TileEntityChemicalOxidizer.java index 8bfcda42a..89dd3e123 100644 --- a/src/main/java/mekanism/common/tile/TileEntityChemicalOxidizer.java +++ b/src/main/java/mekanism/common/tile/TileEntityChemicalOxidizer.java @@ -368,14 +368,14 @@ public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock imp { if(gasTank.getGas() != null) { - itemStack.stackTagCompound.setTag("gasTank", gasTank.getGas().write(new NBTTagCompound())); + itemStack.getTagCompound().setTag("gasTank", gasTank.getGas().write(new NBTTagCompound())); } } @Override public void readSustainedData(ItemStack itemStack) { - gasTank.setGas(GasStack.readFromNBT(itemStack.stackTagCompound.getCompoundTag("gasTank"))); + gasTank.setGas(GasStack.readFromNBT(itemStack.getTagCompound().getCompoundTag("gasTank"))); } @Override diff --git a/src/main/java/mekanism/common/tile/TileEntityChemicalWasher.java b/src/main/java/mekanism/common/tile/TileEntityChemicalWasher.java index 4f777f81f..cfd1ad3a4 100644 --- a/src/main/java/mekanism/common/tile/TileEntityChemicalWasher.java +++ b/src/main/java/mekanism/common/tile/TileEntityChemicalWasher.java @@ -586,26 +586,26 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple { if(fluidTank.getFluid() != null) { - itemStack.stackTagCompound.setTag("fluidTank", fluidTank.getFluid().writeToNBT(new NBTTagCompound())); + itemStack.getTagCompound().setTag("fluidTank", fluidTank.getFluid().writeToNBT(new NBTTagCompound())); } if(inputTank.getGas() != null) { - itemStack.stackTagCompound.setTag("inputTank", inputTank.getGas().write(new NBTTagCompound())); + itemStack.getTagCompound().setTag("inputTank", inputTank.getGas().write(new NBTTagCompound())); } if(outputTank.getGas() != null) { - itemStack.stackTagCompound.setTag("outputTank", outputTank.getGas().write(new NBTTagCompound())); + itemStack.getTagCompound().setTag("outputTank", outputTank.getGas().write(new NBTTagCompound())); } } @Override public void readSustainedData(ItemStack itemStack) { - fluidTank.setFluid(FluidStack.loadFluidStackFromNBT(itemStack.stackTagCompound.getCompoundTag("fluidTank"))); - inputTank.setGas(GasStack.readFromNBT(itemStack.stackTagCompound.getCompoundTag("inputTank"))); - outputTank.setGas(GasStack.readFromNBT(itemStack.stackTagCompound.getCompoundTag("outputTank"))); + fluidTank.setFluid(FluidStack.loadFluidStackFromNBT(itemStack.getTagCompound().getCompoundTag("fluidTank"))); + inputTank.setGas(GasStack.readFromNBT(itemStack.getTagCompound().getCompoundTag("inputTank"))); + outputTank.setGas(GasStack.readFromNBT(itemStack.getTagCompound().getCompoundTag("outputTank"))); } @Override diff --git a/src/main/java/mekanism/common/tile/TileEntityDigitalMiner.java b/src/main/java/mekanism/common/tile/TileEntityDigitalMiner.java index fafe19fb7..4cbbfcd7d 100644 --- a/src/main/java/mekanism/common/tile/TileEntityDigitalMiner.java +++ b/src/main/java/mekanism/common/tile/TileEntityDigitalMiner.java @@ -1404,15 +1404,15 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I public void writeSustainedData(ItemStack itemStack) { - itemStack.stackTagCompound.setBoolean("hasMinerConfig", true); + itemStack.getTagCompound().setBoolean("hasMinerConfig", true); - itemStack.stackTagCompound.setInteger("radius", radius); - itemStack.stackTagCompound.setInteger("minY", minY); - itemStack.stackTagCompound.setInteger("maxY", maxY); - itemStack.stackTagCompound.setBoolean("doEject", doEject); - itemStack.stackTagCompound.setBoolean("doPull", doPull); - itemStack.stackTagCompound.setBoolean("silkTouch", silkTouch); - itemStack.stackTagCompound.setBoolean("inverse", inverse); + itemStack.getTagCompound().setInteger("radius", radius); + itemStack.getTagCompound().setInteger("minY", minY); + itemStack.getTagCompound().setInteger("maxY", maxY); + itemStack.getTagCompound().setBoolean("doEject", doEject); + itemStack.getTagCompound().setBoolean("doPull", doPull); + itemStack.getTagCompound().setBoolean("silkTouch", silkTouch); + itemStack.getTagCompound().setBoolean("inverse", inverse); NBTTagList filterTags = new NBTTagList(); @@ -1423,26 +1423,26 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I if(filterTags.tagCount() != 0) { - itemStack.stackTagCompound.setTag("filters", filterTags); + itemStack.getTagCompound().setTag("filters", filterTags); } } @Override public void readSustainedData(ItemStack itemStack) { - if(itemStack.stackTagCompound.hasKey("hasMinerConfig")) + if(itemStack.getTagCompound().hasKey("hasMinerConfig")) { - radius = itemStack.stackTagCompound.getInteger("radius"); - minY = itemStack.stackTagCompound.getInteger("minY"); - maxY = itemStack.stackTagCompound.getInteger("maxY"); - doEject = itemStack.stackTagCompound.getBoolean("doEject"); - doPull = itemStack.stackTagCompound.getBoolean("doPull"); - silkTouch = itemStack.stackTagCompound.getBoolean("silkTouch"); - inverse = itemStack.stackTagCompound.getBoolean("inverse"); + radius = itemStack.getTagCompound().getInteger("radius"); + minY = itemStack.getTagCompound().getInteger("minY"); + maxY = itemStack.getTagCompound().getInteger("maxY"); + doEject = itemStack.getTagCompound().getBoolean("doEject"); + doPull = itemStack.getTagCompound().getBoolean("doPull"); + silkTouch = itemStack.getTagCompound().getBoolean("silkTouch"); + inverse = itemStack.getTagCompound().getBoolean("inverse"); - if(itemStack.stackTagCompound.hasKey("filters")) + if(itemStack.getTagCompound().hasKey("filters")) { - NBTTagList tagList = itemStack.stackTagCompound.getTagList("filters", NBT.TAG_COMPOUND); + NBTTagList tagList = itemStack.getTagCompound().getTagList("filters", NBT.TAG_COMPOUND); for(int i = 0; i < tagList.tagCount(); i++) { diff --git a/src/main/java/mekanism/common/tile/TileEntityElectrolyticSeparator.java b/src/main/java/mekanism/common/tile/TileEntityElectrolyticSeparator.java index 884f1715a..c9a77b886 100644 --- a/src/main/java/mekanism/common/tile/TileEntityElectrolyticSeparator.java +++ b/src/main/java/mekanism/common/tile/TileEntityElectrolyticSeparator.java @@ -625,26 +625,26 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp { if(fluidTank.getFluid() != null) { - itemStack.stackTagCompound.setTag("fluidTank", fluidTank.getFluid().writeToNBT(new NBTTagCompound())); + itemStack.getTagCompound().setTag("fluidTank", fluidTank.getFluid().writeToNBT(new NBTTagCompound())); } if(leftTank.getGas() != null) { - itemStack.stackTagCompound.setTag("leftTank", leftTank.getGas().write(new NBTTagCompound())); + itemStack.getTagCompound().setTag("leftTank", leftTank.getGas().write(new NBTTagCompound())); } if(rightTank.getGas() != null) { - itemStack.stackTagCompound.setTag("rightTank", rightTank.getGas().write(new NBTTagCompound())); + itemStack.getTagCompound().setTag("rightTank", rightTank.getGas().write(new NBTTagCompound())); } } @Override public void readSustainedData(ItemStack itemStack) { - fluidTank.setFluid(FluidStack.loadFluidStackFromNBT(itemStack.stackTagCompound.getCompoundTag("fluidTank"))); - leftTank.setGas(GasStack.readFromNBT(itemStack.stackTagCompound.getCompoundTag("leftTank"))); - rightTank.setGas(GasStack.readFromNBT(itemStack.stackTagCompound.getCompoundTag("rightTank"))); + fluidTank.setFluid(FluidStack.loadFluidStackFromNBT(itemStack.getTagCompound().getCompoundTag("fluidTank"))); + leftTank.setGas(GasStack.readFromNBT(itemStack.getTagCompound().getCompoundTag("leftTank"))); + rightTank.setGas(GasStack.readFromNBT(itemStack.getTagCompound().getCompoundTag("rightTank"))); } @Override diff --git a/src/main/java/mekanism/common/tile/TileEntityFactory.java b/src/main/java/mekanism/common/tile/TileEntityFactory.java index 6113c1a4c..4a4062757 100644 --- a/src/main/java/mekanism/common/tile/TileEntityFactory.java +++ b/src/main/java/mekanism/common/tile/TileEntityFactory.java @@ -285,14 +285,14 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I ItemStack returnStack = getMachineStack(); - if(returnStack.stackTagCompound == null) + if(returnStack.getTagCompound() == null) { returnStack.setTagCompound(new NBTTagCompound()); } - upgradeComponent.write(returnStack.stackTagCompound); + upgradeComponent.write(returnStack.getTagCompound()); upgradeComponent.setSupported(Upgrade.GAS, toSet.fuelEnergyUpgrades()); - upgradeComponent.read(inventory[2].stackTagCompound); + upgradeComponent.read(inventory[2].getTagCompound()); inventory[2] = null; inventory[3] = returnStack; diff --git a/src/main/java/mekanism/common/tile/TileEntityLogisticalSorter.java b/src/main/java/mekanism/common/tile/TileEntityLogisticalSorter.java index 968000d11..9fdbc398a 100644 --- a/src/main/java/mekanism/common/tile/TileEntityLogisticalSorter.java +++ b/src/main/java/mekanism/common/tile/TileEntityLogisticalSorter.java @@ -646,15 +646,15 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen @Override public void writeSustainedData(ItemStack itemStack) { - itemStack.stackTagCompound.setBoolean("hasSorterConfig", true); + itemStack.getTagCompound().setBoolean("hasSorterConfig", true); if(color != null) { - itemStack.stackTagCompound.setInteger("color", TransporterUtils.colors.indexOf(color)); + itemStack.getTagCompound().setInteger("color", TransporterUtils.colors.indexOf(color)); } - itemStack.stackTagCompound.setBoolean("autoEject", autoEject); - itemStack.stackTagCompound.setBoolean("roundRobin", roundRobin); + itemStack.getTagCompound().setBoolean("autoEject", autoEject); + itemStack.getTagCompound().setBoolean("roundRobin", roundRobin); NBTTagList filterTags = new NBTTagList(); @@ -667,26 +667,26 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen if(filterTags.tagCount() != 0) { - itemStack.stackTagCompound.setTag("filters", filterTags); + itemStack.getTagCompound().setTag("filters", filterTags); } } @Override public void readSustainedData(ItemStack itemStack) { - if(itemStack.stackTagCompound.hasKey("hasSorterConfig")) + if(itemStack.getTagCompound().hasKey("hasSorterConfig")) { - if(itemStack.stackTagCompound.hasKey("color")) + if(itemStack.getTagCompound().hasKey("color")) { - color = TransporterUtils.colors.get(itemStack.stackTagCompound.getInteger("color")); + color = TransporterUtils.colors.get(itemStack.getTagCompound().getInteger("color")); } - autoEject = itemStack.stackTagCompound.getBoolean("autoEject"); - roundRobin = itemStack.stackTagCompound.getBoolean("roundRobin"); + autoEject = itemStack.getTagCompound().getBoolean("autoEject"); + roundRobin = itemStack.getTagCompound().getBoolean("roundRobin"); - if(itemStack.stackTagCompound.hasKey("filters")) + if(itemStack.getTagCompound().hasKey("filters")) { - NBTTagList tagList = itemStack.stackTagCompound.getTagList("filters", NBT.TAG_COMPOUND); + NBTTagList tagList = itemStack.getTagCompound().getTagList("filters", NBT.TAG_COMPOUND); for(int i = 0; i < tagList.tagCount(); i++) { diff --git a/src/main/java/mekanism/common/tile/TileEntityOredictionificator.java b/src/main/java/mekanism/common/tile/TileEntityOredictionificator.java index 7abae1e94..539e32000 100644 --- a/src/main/java/mekanism/common/tile/TileEntityOredictionificator.java +++ b/src/main/java/mekanism/common/tile/TileEntityOredictionificator.java @@ -368,7 +368,7 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple @Override public void writeSustainedData(ItemStack itemStack) { - itemStack.stackTagCompound.setBoolean("hasOredictionificatorConfig", true); + itemStack.getTagCompound().setBoolean("hasOredictionificatorConfig", true); NBTTagList filterTags = new NBTTagList(); @@ -381,18 +381,18 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple if(filterTags.tagCount() != 0) { - itemStack.stackTagCompound.setTag("filters", filterTags); + itemStack.getTagCompound().setTag("filters", filterTags); } } @Override public void readSustainedData(ItemStack itemStack) { - if(itemStack.stackTagCompound.hasKey("hasOredictionificatorConfig")) + if(itemStack.getTagCompound().hasKey("hasOredictionificatorConfig")) { - if(itemStack.stackTagCompound.hasKey("filters")) + if(itemStack.getTagCompound().hasKey("filters")) { - NBTTagList tagList = itemStack.stackTagCompound.getTagList("filters", NBT.TAG_COMPOUND); + NBTTagList tagList = itemStack.getTagCompound().getTagList("filters", NBT.TAG_COMPOUND); for(int i = 0; i < tagList.tagCount(); i++) { diff --git a/src/main/java/mekanism/common/tile/TileEntityPRC.java b/src/main/java/mekanism/common/tile/TileEntityPRC.java index 8e40b0840..29da14cd1 100644 --- a/src/main/java/mekanism/common/tile/TileEntityPRC.java +++ b/src/main/java/mekanism/common/tile/TileEntityPRC.java @@ -436,26 +436,26 @@ public class TileEntityPRC extends TileEntityBasicMachine