More progress on getting sigils to follow the events
This commit is contained in:
parent
39b4243a82
commit
369ca6440f
|
@ -110,18 +110,12 @@ public class SigilOfElementalAffinity extends EnergyItems
|
|||
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.waterBreathing.id, 2, 0, true));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true));
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
||||
|
@ -158,6 +152,7 @@ public class SigilOfElementalAffinity extends EnergyItems
|
|||
{
|
||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.stackTagCompound.setBoolean("isActive", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -140,15 +140,10 @@ public class SigilOfGrowth 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) % tickDelay);
|
||||
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed());
|
||||
}
|
||||
} else
|
||||
{
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
||||
|
@ -175,7 +170,10 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade
|
|||
{
|
||||
if (par2World.getWorldTime() % tickDelay == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed());
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.stackTagCompound.setBoolean("isActive", false);
|
||||
}
|
||||
}
|
||||
int range = 5;
|
||||
int verticalRange = 2;
|
||||
|
|
|
@ -109,17 +109,11 @@ public class SigilOfHaste 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.customPotionBoost.id, 3, 1));
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
||||
|
@ -154,6 +148,7 @@ public class SigilOfHaste extends EnergyItems implements ArmourUpgrade
|
|||
{
|
||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.stackTagCompound.setBoolean("isActive", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,15 +109,10 @@ public class SigilOfMagnetism 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) % tickDelay);
|
||||
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed());
|
||||
}
|
||||
} else
|
||||
{
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
||||
|
@ -145,7 +140,10 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade
|
|||
{
|
||||
if (par2World.getWorldTime() % tickDelay == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed());
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.stackTagCompound.setBoolean("isActive", false);
|
||||
}
|
||||
}
|
||||
|
||||
int range = 5;
|
||||
|
|
|
@ -112,15 +112,10 @@ public class SigilOfTheBridge 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) % tickDelay);
|
||||
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed());
|
||||
}
|
||||
} else
|
||||
{
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
||||
|
@ -148,8 +143,13 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade
|
|||
{
|
||||
if (par2World.getWorldTime() % tickDelay == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, this.getLPUsed(par1ItemStack));
|
||||
this.setLPUsed(par1ItemStack, 0);
|
||||
if(EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, this.getLPUsed(par1ItemStack)))
|
||||
{
|
||||
this.setLPUsed(par1ItemStack, 0);
|
||||
}else
|
||||
{
|
||||
par1ItemStack.stackTagCompound.setBoolean("isActive", false);
|
||||
}
|
||||
}
|
||||
if (!par3EntityPlayer.onGround && !par3EntityPlayer.isSneaking())
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue