Sigils should draw LP from the bound network, not the user

(cherry picked from commit 082d2b8)
This commit is contained in:
Nicholas Ignoffo 2016-12-19 17:32:03 -08:00
parent 852d32f233
commit c46ed3e648
14 changed files with 14 additions and 18 deletions

View file

@ -65,7 +65,7 @@ public class ItemSigilToggleable extends ItemSigil implements IActivatable
@Override
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
{
return (NetworkHelper.getSoulNetwork(player).syphonAndDamage(player, getLpUsed()) && onSigilUse(player.getHeldItem(hand), player, world, pos, side, hitX, hitY, hitZ)) ? EnumActionResult.SUCCESS : EnumActionResult.FAIL;
return (NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).syphonAndDamage(player, getLpUsed()) && onSigilUse(player.getHeldItem(hand), player, world, pos, side, hitX, hitY, hitZ)) ? EnumActionResult.SUCCESS : EnumActionResult.FAIL;
}
public boolean onSigilUse(ItemStack itemStack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ)
@ -80,7 +80,7 @@ public class ItemSigilToggleable extends ItemSigil implements IActivatable
{
if (entityIn.ticksExisted % 100 == 0)
{
if (!NetworkHelper.getSoulNetwork((EntityPlayerMP) entityIn).syphonAndDamage((EntityPlayer) entityIn, getLpUsed()))
if (!NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).syphonAndDamage((EntityPlayer) entityIn, getLpUsed()))
{
setActivatedState(stack, false);
}

View file

@ -110,7 +110,9 @@ public class NetworkHelper
* - Amount of LP to syphon
*
* @return - Whether the action should be performed.
* @deprecated Use {@link #getSoulNetwork(EntityPlayer)} and {@link SoulNetwork#syphonAndDamage(EntityPlayer, int)}
*/
@Deprecated
public static boolean syphonAndDamage(SoulNetwork soulNetwork, EntityPlayer user, int toSyphon)
{