MCPcopy Index your code
hub / github.com/Cortex-MC/SimpAPI / open

Method open

src/main/java/me/kodysimpson/simpapi/menu/Menu.java:53–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51
52 //When called, an inventory is created and opened for the player
53 public void open() {
54 //The owner of the inventory created is the Menu itself,
55 // so we are able to reverse engineer the Menu object from the
56 // inventoryHolder in the MenuListener class when handling clicks
57 inventory = Bukkit.createInventory(this, getSlots(), getMenuName());
58
59 //grab all the items specified to be used for this menu and add to inventory
60 this.setMenuItems();
61
62 //open the inventory for the player
63 playerMenuUtility.getOwner().openInventory(inventory);
64 playerMenuUtility.pushMenu(this);
65 }
66
67 public void back() throws MenuManagerException, MenuManagerNotSetupException {
68 MenuManager.openMenu(playerMenuUtility.lastMenu().getClass(), playerMenuUtility.getOwner());

Callers 1

openMenuMethod · 0.45

Calls 5

getSlotsMethod · 0.95
getMenuNameMethod · 0.95
setMenuItemsMethod · 0.95
getOwnerMethod · 0.80
pushMenuMethod · 0.80

Tested by

no test coverage detected