From f80d579c7b40ddf9247885d17b061a0ae42b1608 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Wed, 14 Mar 2012 00:02:20 -0400 Subject: [PATCH] [Bleeding] Add Inventory.{get,set}MaxStackSize(). Addresses BUKKIT-1076 By: Celtic Minstrel --- .../java/org/bukkit/inventory/Inventory.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/inventory/Inventory.java b/paper-api/src/main/java/org/bukkit/inventory/Inventory.java index b42ffe2172..c5dc995cad 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/Inventory.java +++ b/paper-api/src/main/java/org/bukkit/inventory/Inventory.java @@ -20,6 +20,26 @@ public interface Inventory extends Iterable { */ public int getSize(); + /** + * @return The maximum stack size for items in this inventory. + */ + public int getMaxStackSize(); + + /** + * This method allows you to change the maximum stack size for an inventory. + *

Caveats: + *

    + *
  • Not all inventories respect this value. + *
  • Stacks larger than 127 may be clipped when the world is saved. + *
  • This value is not guaranteed to be preserved; be sure to set it before every time + * you want to set a slot over the max stack size. + *
  • Stacks larger than the default max size for this type of inventory may not display + * correctly in the client. + *
+ * @param size The new maximum stack size for items in this inventory. + */ + public void setMaxStackSize(int size); + /** * Return the name of the inventory *