Attempting to force item nbt to send to client
This commit is contained in:
parent
0304fb66f7
commit
1e952c621a
1 changed files with 5 additions and 9 deletions
|
@ -182,6 +182,10 @@ public class ItemCommonTool extends Item implements IExtraItemInfo
|
|||
int currentDamage = itemStack.getTagCompound().getInteger("toolDamage") + damage;
|
||||
damage = Math.max(Math.min(damage, mat.maxUses), 0);
|
||||
itemStack.getTagCompound().setInteger("toolDamage", damage);
|
||||
if (entity instanceof EntityPlayer)
|
||||
{
|
||||
((EntityPlayer) entity).inventory.onInventoryChanged();
|
||||
}
|
||||
if (currentDamage > mat.maxUses)
|
||||
{
|
||||
entity.renderBrokenItemStack(itemStack);
|
||||
|
@ -213,14 +217,6 @@ public class ItemCommonTool extends Item implements IExtraItemInfo
|
|||
@Override
|
||||
public boolean hitEntity(ItemStack itemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
|
||||
{
|
||||
if (itemStack.getTagCompound() == null)
|
||||
{
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
if (itemStack.getTagCompound().getBoolean("broken"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
this.damage(itemStack, 2, par2EntityLivingBase);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue