diff options
author | Nathan Adams <dinnerbone@dinnerbone.com> | 2012-01-15 09:52:56 +0000 |
---|---|---|
committer | Nathan Adams <dinnerbone@dinnerbone.com> | 2012-01-15 10:00:27 +0000 |
commit | f442a92c1ede92943c80baf4b265c612113279b3 (patch) | |
tree | 1e6477ded157cd6faffbc321b3578f196b5a1373 /src/main | |
parent | 039ec8a56342a359790d96a395b74663dce61487 (diff) | |
download | bukkit-f442a92c1ede92943c80baf4b265c612113279b3.tar bukkit-f442a92c1ede92943c80baf4b265c612113279b3.tar.gz bukkit-f442a92c1ede92943c80baf4b265c612113279b3.tar.lz bukkit-f442a92c1ede92943c80baf4b265c612113279b3.tar.xz bukkit-f442a92c1ede92943c80baf4b265c612113279b3.zip |
ItemStack.getMaxStackSize no longer incorrectly returns -1 when not backed by an NMS instance. Thanks to feildmaster for the PR. This fixes BUKKIT-530
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/inventory/ItemStack.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java index d8256fca..c856b3ae 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -174,6 +174,11 @@ public class ItemStack implements ConfigurationSerializable { * @return The maximum you can stack this material to. */ public int getMaxStackSize() { + Material material = getType(); + if (material != null) { + return material.getMaxStackSize(); + } + return -1; } |