Commits

eueln authored and turt2live committed 562af14d25b
Allow inventory creation by InventoryType and title. Fixes BUKKIT-4045

Up until now it has not been possible to create a new Inventory using a custom title and permit any InventoryType available. The commit changes that by adding a method to optionally supply the title for the given inventory type and holder, creating the functionality to display any supported inventory type with a 32 character length String. If the inventory title supplied is larger than 32 characters then an IllegalArgumentException is thrown stating so.
No tags

src/main/java/org/bukkit/Bukkit.java

Modified
584 584 return server.getOfflinePlayers();
585 585 }
586 586
587 587 /**
588 588 * @see Server#createInventory(InventoryHolder owner, InventoryType type)
589 589 */
590 590 public static Inventory createInventory(InventoryHolder owner, InventoryType type) {
591 591 return server.createInventory(owner, type);
592 592 }
593 593
594 + /**
595 + * @see Server#createInventory(InventoryHolder owner, InventoryType type, String title)
596 + */
597 + public static Inventory createInventory(InventoryHolder owner, InventoryType type, String title) {
598 + return server.createInventory(owner, type, title);
599 + }
600 +
594 601 /**
595 602 * @see Server#createInventory(InventoryHolder owner, int size)
596 603 */
597 604 public static Inventory createInventory(InventoryHolder owner, int size) {
598 605 return server.createInventory(owner, size);
599 606 }
600 607
601 608 /**
602 609 * @see Server#createInventory(InventoryHolder owner, int size, String
603 610 * title)

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut