Refactoring

This commit is contained in:
WayofTime 2015-01-16 10:00:50 -05:00
parent fd330233dd
commit 56ccd3188d
76 changed files with 876 additions and 433 deletions

View file

@ -38,9 +38,9 @@ public class ItemPackRatSigil extends EnergyItems implements IHolding, ArmourUpg
{
par3List.add("Hands of Diamonds");
if (!(par1ItemStack.stackTagCompound == null))
if (!(par1ItemStack.getTagCompound() == null))
{
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
{
par3List.add("Activated");
} else
@ -48,7 +48,7 @@ public class ItemPackRatSigil extends EnergyItems implements IHolding, ArmourUpg
par3List.add("Deactivated");
}
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName"));
}
}
@ -64,12 +64,12 @@ public class ItemPackRatSigil extends EnergyItems implements IHolding, ArmourUpg
@Override
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
if (stack.stackTagCompound == null)
if (stack.getTagCompound() == null)
{
stack.setTagCompound(new NBTTagCompound());
}
NBTTagCompound tag = stack.stackTagCompound;
NBTTagCompound tag = stack.getTagCompound();
if (tag.getBoolean("isActive"))
{
@ -103,12 +103,12 @@ public class ItemPackRatSigil extends EnergyItems implements IHolding, ArmourUpg
return par1ItemStack;
}
if (par1ItemStack.stackTagCompound == null)
if (par1ItemStack.getTagCompound() == null)
{
par1ItemStack.setTagCompound(new NBTTagCompound());
}
NBTTagCompound tag = par1ItemStack.stackTagCompound;
NBTTagCompound tag = par1ItemStack.getTagCompound();
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
if (tag.getBoolean("isActive"))
@ -141,12 +141,12 @@ public class ItemPackRatSigil extends EnergyItems implements IHolding, ArmourUpg
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
if (par1ItemStack.stackTagCompound == null)
if (par1ItemStack.getTagCompound() == null)
{
par1ItemStack.setTagCompound(new NBTTagCompound());
}
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
{
ItemStack stack = CompressionRegistry.compressInventory(par3EntityPlayer.inventory.mainInventory, par2World);
if(stack != null)
@ -155,13 +155,13 @@ public class ItemPackRatSigil extends EnergyItems implements IHolding, ArmourUpg
par2World.spawnEntityInWorld(entityItem);
}
}
if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive"))
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{
par1ItemStack.stackTagCompound.setBoolean("isActive", false);
par1ItemStack.getTagCompound().setBoolean("isActive", false);
}
}
}