mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-03 13:36:44 +01:00
Fixed durability changing regardless of whether or not damage was successful. Thanks Xolsom!
Note: Plugins may need to update the client to keep it in synch.
This commit is contained in:
parent
ef9295707a
commit
6bd509ebde
1 changed files with 6 additions and 1 deletions
|
@ -534,7 +534,12 @@ public abstract class EntityHuman extends EntityLiving {
|
|||
}
|
||||
// CraftBukkit end
|
||||
|
||||
entity.damageEntity(this, i);
|
||||
// CraftBukkit start - Return when the damage fails so that the item will not lose durability
|
||||
if (!entity.damageEntity(this, i)) {
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
ItemStack itemstack = this.F();
|
||||
|
||||
if (itemstack != null && entity instanceof EntityLiving) {
|
||||
|
|
Loading…
Reference in a new issue