Added AddToNetworkEvent

This commit is contained in:
WayofTime 2014-11-07 16:22:29 -05:00
parent 369ca6440f
commit 8ac6cc76d8
5 changed files with 77 additions and 20 deletions

View file

@ -110,17 +110,11 @@ public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade
NBTTagCompound tag = par1ItemStack.stackTagCompound;
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
if (tag.getBoolean("isActive"))
if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{
par1ItemStack.setItemDamage(1);
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2, 1, true));
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{
}
}
} else
{
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
@ -155,6 +149,7 @@ public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade
{
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{
par1ItemStack.stackTagCompound.setBoolean("isActive", false);
}
}
}

View file

@ -109,17 +109,11 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade
NBTTagCompound tag = par1ItemStack.stackTagCompound;
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
if (tag.getBoolean("isActive"))
if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{
par1ItemStack.setItemDamage(1);
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1));
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{
}
}
} else
{
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
@ -154,6 +148,7 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade
{
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{
par1ItemStack.stackTagCompound.setBoolean("isActive", false);
}
}
}