Download the newest version of the API's and import them into you're plugins You don't have to make a Spigot Plugin with the Library, only if you want to change something described in the following spigot documentation Don't export the Libraries, just put them on your servers as plugins.
BungeeInventory chestInventory = new BungeeInventory("§7Server-GUI", 3*9);
BungeeInventory furnaceInventory = new BungeeInventory("§7Multi Server Furnace", InventoryType.FURNACE);
ItemStack lobbyItem = new ItemStack("CLOCK", "§6Lobby", "§7Click to be send to the Lobby");
ItemStack pvpItem = new ItemStack("DIAMOND_SWORD", "§bPvP");
inventory.addItem(pvpItem);
inventory.setItem(15, lobbyItem);
You can choose an OpenInventoryType
to choose when the inventory should open or not.
Default value is OpenInventoryType.ALWAYS
BungeeInventoryManager.getInstance().sendInventory(player, inventory);
BungeeInventoryManager.getInstance().sendInventory(player, inventory, OpenInventoryType.ONLY_WHEN_INVENTORY_CLOSED);
With overwriting this Factory
you can block sending specified inventories when a condition is true or lots of other Things.
This Factory
returns a boolean
.
BungeeInventoryManager.getInstance().setMaySendInventory((player, inventory) -> {
if (...) {
// Inventory will be sent to Spigot Server
return true;
}
// Inventory will not be sent to Spigot Server
return false;
});
With overwriting this Factory
you can block sending specified inventories when a condition is true or lots of other Things like play Sounds.
This Factory
returns a boolean
.
BungeeInventoryManager.getInstance().setMayOpenInventory((player, inventory) -> {
if (...) {
// Inventory will be opened
return true;
}
// Inventory will not be opened
return false;
});