diff options
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemStack.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemStack.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java index cd6dd070..09b46789 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -149,6 +149,19 @@ public final class ItemStack { } public void setData(int i) { + // CraftBukkit start - filter out data for items that shouldn't have it + if (!this.usesData()) { + this.damage = 0; + return; + } + + // Filter wool to avoid confusing the client + if (this.id == Block.WOOL.id) { + this.damage = Math.min(15, i); + return; + } + // CraftBukkit end + this.damage = i; if (this.damage < 0) { this.damage = 0; |