mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-13 11:18:23 +01:00
ItemStack.getMaxStackSize no longer incorrectly returns -1 when not backed by an NMS instance. Thanks to feildmaster for the PR. This fixes BUKKIT-530
By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
10700630bb
commit
62510f93b8
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue