diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java index cd6dd0700a..09b46789b0 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; diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java index 10fedeb4d0..13c27051ad 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -1228,7 +1228,7 @@ public class PlayerConnection extends Connection { this.player.a(this.player.activeContainer, arraylist); // CraftBukkit start - send a Set Slot to update the crafting result slot - if(type == SlotType.RESULT && itemstack != null) { + if (type == SlotType.RESULT && itemstack != null) { this.player.playerConnection.sendPacket((Packet) (new Packet103SetSlot(this.player.activeContainer.windowId, 0, itemstack))); } // CraftBukkit end