Refactoring
This commit is contained in:
parent
fd330233dd
commit
56ccd3188d
76 changed files with 876 additions and 433 deletions
|
@ -45,12 +45,12 @@ public class EnergyBazooka extends EnergyItems
|
|||
@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"))
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ public class EnergyBazooka extends EnergyItems
|
|||
if (par3EntityPlayer.isSneaking())
|
||||
{
|
||||
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
||||
par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
|
||||
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ public class EnergyBazooka extends EnergyItems
|
|||
|
||||
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
|
||||
|
||||
if (par1ItemStack.stackTagCompound == null)
|
||||
if (par1ItemStack.getTagCompound() == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ public class EnergyBazooka extends EnergyItems
|
|||
this.setDelay(par1ItemStack, delay - 1);
|
||||
}
|
||||
|
||||
if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
if (par2World.getWorldTime() % 100 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
|
@ -150,9 +150,9 @@ public class EnergyBazooka extends EnergyItems
|
|||
{
|
||||
par3List.add("Boom.");
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
par3List.add("Activated");
|
||||
} else
|
||||
|
@ -160,16 +160,16 @@ public class EnergyBazooka extends EnergyItems
|
|||
par3List.add("Deactivated");
|
||||
}
|
||||
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
par3List.add("Current owner: " + par1ItemStack.getTagCompound().getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
|
@ -181,7 +181,7 @@ public class EnergyBazooka extends EnergyItems
|
|||
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
|
@ -193,7 +193,7 @@ public class EnergyBazooka extends EnergyItems
|
|||
|
||||
public void setDelay(ItemStack par1ItemStack, int newDelay)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
|
@ -205,7 +205,7 @@ public class EnergyBazooka extends EnergyItems
|
|||
|
||||
public int getDelay(ItemStack par1ItemStack)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue