mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 03:25:15 +01:00
Made item use when a player has the ability to instantly build not decrement the stack. Fixes BUKKIT-1439
This commit is contained in:
parent
f4558f5d7d
commit
7594c91c84
@ -685,9 +685,10 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
ItemStack itemstack = this.U();
|
||||
|
||||
if (itemstack != null && entity instanceof EntityLiving) {
|
||||
if (this.abilities.canInstantlyBuild) itemstack = itemstack.cloneItemStack(); // CraftBukkit - if the player can instantly build, don't decrement the stack.
|
||||
itemstack.a((EntityLiving) entity);
|
||||
// CraftBukkit - bypass infinite items; <= 0 -> == 0
|
||||
if (itemstack.count == 0) {
|
||||
// CraftBukkit - bypass infinite items; <= 0 -> == 0, only remove items if not able to instantly build
|
||||
if (itemstack.count == 0 && !this.abilities.canInstantlyBuild) {
|
||||
itemstack.a(this);
|
||||
this.V();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user