summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/bukkit/inventory/ItemStack.java5
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;
}