From 04baecf5ef4015f3461d17931363e89c29a6ab19 Mon Sep 17 00:00:00 2001 From: Guinea Wheek Date: Tue, 9 Aug 2022 22:43:10 -0700 Subject: [PATCH] Fix the Key of Binding in multiplayer (#28) * Fix the Key of Binding in multiplayer * Add suggested other refactors --- .../alchemicalWizardry/common/items/ItemDiabloKey.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemDiabloKey.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemDiabloKey.java index 3b9c33fb..64cf00bd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemDiabloKey.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemDiabloKey.java @@ -50,7 +50,7 @@ public class ItemDiabloKey extends EnergyItems public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { World world = par3EntityPlayer.worldObj; - if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer instanceof FakePlayer || par3EntityPlayer instanceof EntityPlayerMP) + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer instanceof FakePlayer) { return par1ItemStack; } @@ -64,7 +64,7 @@ public class ItemDiabloKey extends EnergyItems SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ); } - if (!par3EntityPlayer.worldObj.isRemote && !(par3EntityPlayer.getClass().equals(EntityPlayerMP.class))) + if (par3EntityPlayer.worldObj.isRemote) { return par1ItemStack; } @@ -103,6 +103,7 @@ public class ItemDiabloKey extends EnergyItems EnergyItems.checkAndSetItemOwner(itemStack, ownerName); } } + par3EntityPlayer.inventoryContainer.detectAndSendChanges(); return par1ItemStack; }