Skip to content

Commit

Permalink
Fix the Key of Binding in multiplayer (#28)
Browse files Browse the repository at this point in the history
* Fix the Key of Binding in multiplayer

* Add suggested other refactors
  • Loading branch information
guineawheek authored Aug 10, 2022
1 parent 9cf6c3a commit 04baecf
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlaye
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;
}
Expand All @@ -64,7 +64,7 @@ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, Enti
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;
}
Expand Down Expand Up @@ -103,6 +103,7 @@ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, Enti
EnergyItems.checkAndSetItemOwner(itemStack, ownerName);
}
}
par3EntityPlayer.inventoryContainer.detectAndSendChanges();

return par1ItemStack;
}
Expand Down

0 comments on commit 04baecf

Please sign in to comment.