From 7594c91c84034ab289b4549a73db74dcd18c9e4a Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Mon, 2 Apr 2012 13:24:34 -0400 Subject: [PATCH] Made item use when a player has the ability to instantly build not decrement the stack. Fixes BUKKIT-1439 --- src/main/java/net/minecraft/server/EntityHuman.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java index 5c29744aec..c552f000ad 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -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(); }