diff options
Diffstat (limited to 'src/main/java/org/bukkit/Server.java')
-rw-r--r-- | src/main/java/org/bukkit/Server.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java index 958c41e5..dc6e4aa5 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -13,6 +13,9 @@ import org.bukkit.command.CommandSender; import org.bukkit.command.ConsoleCommandSender; import org.bukkit.command.PluginCommand; import org.bukkit.entity.Player; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.Recipe; import org.bukkit.map.MapView; @@ -560,4 +563,33 @@ public interface Server extends PluginMessageRecipient { * @return Messenger responsible for this server. */ public Messenger getMessenger(); + + /** + * Creates an empty inventory of the specified type. If the type is {@link InventoryType#CHEST}, + * the new inventory has a size of 27; otherwise the new inventory has the normal size for + * its type. + * @param owner The holder of the inventory; can be null if there's no holder. + * @param type The type of inventory to create. + * @return The new inventory. + */ + Inventory createInventory(InventoryHolder owner, InventoryType type); + + /** + * Creates an empty inventory of type {@link InventoryType#CHEST} with the specified size. + * @param owner The holder of the inventory; can be null if there's no holder. + * @param size The size of inventory to create; must be a multiple of 9. + * @return The new inventory. + * @throws IllegalArgumentException If the size is not a multiple of 9. + */ + Inventory createInventory(InventoryHolder owner, int size); + + /** + * Creates an empty inventory of type {@link InventoryType#CHEST} with the specified size and title. + * @param owner The holder of the inventory; can be null if there's no holder. + * @param size The size of inventory to create; must be a multiple of 9. + * @param title The title of the inventory, to be displayed when it is viewed. + * @return The new inventory. + * @throws IllegalArgumentException If the size is not a multiple of 9. + */ + Inventory createInventory(InventoryHolder owner, int size, String title); } |