stackTagCompound -> getTagCompound()

This commit is contained in:
Ben Spiers committed 2016-01-23 14:15:58 +00:00
1 parent 9b2dbcbe3e
commit 4ef5840ff9
38 files changed
+300 -300

No files matched your search

@@ -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<Upgrade, Integer> upgrades = Upgrade.buildMap(itemstack.stackTagCompound);
Map<Upgrade, Integer> upgrades = Upgrade.buildMap(itemstack.getTagCompound());
for(Map.Entry<Upgrade, Integer> 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