ItemStack.getMaxStackSize no longer incorrectly returns -1 when not backed by an NMS instance. Thanks to feildmaster for the PR. This fixes BUKKIT-530
This commit is contained in:
parent
039ec8a563
commit
f442a92c1e
@ -174,6 +174,11 @@ public class ItemStack implements ConfigurationSerializable {
|
|||||||
* @return The maximum you can stack this material to.
|
* @return The maximum you can stack this material to.
|
||||||
*/
|
*/
|
||||||
public int getMaxStackSize() {
|
public int getMaxStackSize() {
|
||||||
|
Material material = getType();
|
||||||
|
if (material != null) {
|
||||||
|
return material.getMaxStackSize();
|
||||||
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user