diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2013-12-13 18:52:33 -0600 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-12-13 18:52:33 -0600 |
commit | fbe062caf5c29d153a27b5ab2d06a6e3a795ef15 (patch) | |
tree | 34deb9eaf78e171f2553e1365ba85791d647dbfc /src/main/java/net/minecraft | |
parent | f5fad449bd3b9c822318a0bc2e97c51147bb2c2b (diff) | |
download | craftbukkit-fbe062caf5c29d153a27b5ab2d06a6e3a795ef15.tar craftbukkit-fbe062caf5c29d153a27b5ab2d06a6e3a795ef15.tar.gz craftbukkit-fbe062caf5c29d153a27b5ab2d06a6e3a795ef15.tar.lz craftbukkit-fbe062caf5c29d153a27b5ab2d06a6e3a795ef15.tar.xz craftbukkit-fbe062caf5c29d153a27b5ab2d06a6e3a795ef15.zip |
Only filter data from block items, not all of them. Fixes BUKKIT-5047
Diffstat (limited to 'src/main/java/net/minecraft')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemStack.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java index 53c665b8..b308e035 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -6,6 +6,8 @@ import java.util.Random; import net.minecraft.util.com.google.common.collect.HashMultimap; import net.minecraft.util.com.google.common.collect.Multimap; +import org.bukkit.craftbukkit.util.CraftMagicNumbers; // CraftBukkit + public final class ItemStack { public static final DecimalFormat a = new DecimalFormat("#.###"); @@ -155,13 +157,12 @@ public final class ItemStack { return; } - if (!(this.usesData() || this.getItem().usesDurability())) { // || this.id > 255)) { - i = 0; - } - - // Filter wool to avoid confusing the client - if (this.getItem() == Item.getItemOf(Blocks.WOOL)) { - i = Math.min(15, i); + // Is this a block? + if (CraftMagicNumbers.getBlock(CraftMagicNumbers.getId(this.getItem())) != Blocks.AIR) { + // If vanilla doesn't use data on it don't allow any + if (!(this.usesData() || this.getItem().usesDurability())) { + i = 0; + } } // CraftBukkit end |