Changes to Item Binding

Allows event to cancel the binding (rather than set key to "" which had
the same effect but was messy)

Prevents binding by Fake Players
This commit is contained in:
hilburn 2015-01-31 23:37:17 +00:00
parent aa33b6b8ff
commit 976599afe0
50 changed files with 152 additions and 268 deletions

View file

@ -108,9 +108,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if (par3EntityPlayer.isSneaking())
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
{
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);