use of org.bukkit.inventory.Inventory in project EliteMobs by MagmaGuy.
the class CustomShopMenu method customShopConstructor.
/**
* Creates a new instance of a custom shop
*
* @param player Player for whom the new menu will show up
*/
public static void customShopConstructor(Player player) {
Inventory shopInventory = Bukkit.createInventory(player, 54, SHOP_NAME);
populateShop(shopInventory, player);
player.openInventory(shopInventory);
}
use of org.bukkit.inventory.Inventory in project EliteMobs by MagmaGuy.
the class EnhancementMenu method constructEnhancementMenu.
/**
* Creates a menu for scrapping elitemobs items. Only special Elite Mob items can be scrapped here.
*
* @param player Player for whom the inventory will be created
*/
public void constructEnhancementMenu(Player player) {
Inventory EnhancementInventory = Bukkit.createInventory(player, 54, EnhancementMenuConfig.shopName);
for (int i = 0; i < EnhancementInventory.getSize(); i++) {
if (i == EnhancementMenuConfig.infoSlot) {
EnhancementInventory.setItem(i, EnhancementMenuConfig.infoButton);
continue;
}
if (i == EnhancementMenuConfig.cancelSlot) {
EnhancementInventory.setItem(i, EnhancementMenuConfig.cancelButton);
continue;
}
if (i == eliteItemInformationInputSlot) {
EnhancementInventory.setItem(i, EnhancementMenuConfig.eliteItemInputInfoButton);
continue;
}
if (i == eliteScrapInformationInputSlot) {
EnhancementInventory.setItem(i, EnhancementMenuConfig.eliteUpgradeOrbInputInfoButton);
continue;
}
if (i == informationOutputSlot) {
EnhancementInventory.setItem(i, EnhancementMenuConfig.outputInfoButton);
continue;
}
if (i == EnhancementMenuConfig.confirmSlot) {
ItemStack clonedConfirmButton = EnhancementMenuConfig.confirmButton.clone();
List<String> lore = new ArrayList<>();
for (String string : EnhancementMenuConfig.confirmButton.getItemMeta().getLore()) lore.add(string);
EnhancementMenuConfig.confirmButton.getItemMeta().setLore(lore);
ItemMeta clonedMeta = clonedConfirmButton.getItemMeta();
clonedMeta.setLore(lore);
clonedConfirmButton.setItemMeta(clonedMeta);
EnhancementInventory.setItem(i, clonedConfirmButton);
continue;
}
if (i == EnhancementMenuConfig.eliteItemInputSlot || i == EnhancementMenuConfig.eliteUpgradeOrbInputSlot || i == EnhancementMenuConfig.outputSlot)
continue;
EnhancementInventory.setItem(i, ItemStackGenerator.generateItemStack(Material.GLASS_PANE));
}
player.openInventory(EnhancementInventory);
createEliteMenu(player, EnhancementInventory, inventories);
}
use of org.bukkit.inventory.Inventory in project EliteMobs by MagmaGuy.
the class ScrapperMenu method constructScrapMenu.
/**
* Creates a menu for scrapping elitemobs items. Only special Elite Mob items can be scrapped here.
*
* @param player Player for whom the inventory will be created
*/
public void constructScrapMenu(Player player) {
Inventory scrapInventory = Bukkit.createInventory(player, 54, ScrapperMenuConfig.shopName);
for (int i = 0; i < 54; i++) {
if (i == ScrapperMenuConfig.infoSlot) {
scrapInventory.setItem(i, ScrapperMenuConfig.infoButton);
continue;
}
if (i == ScrapperMenuConfig.cancelSlot) {
scrapInventory.setItem(i, ScrapperMenuConfig.cancelButton);
continue;
}
if (i == ScrapperMenuConfig.confirmSlot) {
ItemStack clonedConfirmButton = ScrapperMenuConfig.confirmButton.clone();
List<String> lore = new ArrayList<>();
for (String string : ScrapperMenuConfig.confirmButton.getItemMeta().getLore()) lore.add(string);
ScrapperMenuConfig.confirmButton.getItemMeta().setLore(lore);
ItemMeta clonedMeta = clonedConfirmButton.getItemMeta();
clonedMeta.setLore(lore);
clonedConfirmButton.setItemMeta(clonedMeta);
scrapInventory.setItem(i, clonedConfirmButton);
continue;
}
if (validSlots.contains(i))
continue;
scrapInventory.setItem(i, ItemStackGenerator.generateItemStack(Material.GLASS_PANE));
}
player.openInventory(scrapInventory);
createEliteMenu(player, scrapInventory, inventories);
}
use of org.bukkit.inventory.Inventory in project EliteMobs by MagmaGuy.
the class UnbindMenu method constructUnbinderMenu.
/**
* Creates a menu for scrapping elitemobs items. Only special Elite Mob items can be scrapped here.
*
* @param player Player for whom the inventory will be created
*/
public void constructUnbinderMenu(Player player) {
Inventory UnbinderInventory = Bukkit.createInventory(player, 54, UnbinderMenuConfig.getShopName());
for (int i = 0; i < UnbinderInventory.getSize(); i++) {
if (i == UnbinderMenuConfig.getInfoSlot()) {
UnbinderInventory.setItem(i, UnbinderMenuConfig.getInfoButton());
continue;
}
if (i == UnbinderMenuConfig.getCancelSlot()) {
UnbinderInventory.setItem(i, UnbinderMenuConfig.getCancelButton());
continue;
}
if (i == eliteItemInformationInputSlot) {
UnbinderInventory.setItem(i, UnbinderMenuConfig.getEliteItemInputInfoButton());
continue;
}
if (i == eliteScrapInformationInputSlot) {
UnbinderInventory.setItem(i, UnbinderMenuConfig.getEliteUnbindInputInfoButton());
continue;
}
if (i == informationOutputSlot) {
UnbinderInventory.setItem(i, UnbinderMenuConfig.getOutputInfoButton());
continue;
}
if (i == UnbinderMenuConfig.getConfirmSlot()) {
ItemStack clonedConfirmButton = UnbinderMenuConfig.getConfirmButton().clone();
List<String> lore = new ArrayList<>();
for (String string : UnbinderMenuConfig.getConfirmButton().getItemMeta().getLore()) lore.add(string);
UnbinderMenuConfig.getConfirmButton().getItemMeta().setLore(lore);
ItemMeta clonedMeta = clonedConfirmButton.getItemMeta();
clonedMeta.setLore(lore);
clonedConfirmButton.setItemMeta(clonedMeta);
UnbinderInventory.setItem(i, clonedConfirmButton);
continue;
}
if (i == UnbinderMenuConfig.getEliteItemInputSlot() || i == UnbinderMenuConfig.getEliteUnbindInputSlot() || i == UnbinderMenuConfig.getOutputSlot())
continue;
UnbinderInventory.setItem(i, ItemStackGenerator.generateItemStack(Material.GLASS_PANE));
}
player.openInventory(UnbinderInventory);
createEliteMenu(player, UnbinderInventory, inventories);
}
use of org.bukkit.inventory.Inventory in project EliteMobs by MagmaGuy.
the class BuyOrSellMenu method constructBuyOrSellMenu.
public static void constructBuyOrSellMenu(Player player, ItemStack buyItemStack) {
Inventory shopInventory = Bukkit.createInventory(player, 18, SHOP_NAME);
// information item
shopInventory.setItem(BuyOrSellMenuConfig.INFORMATION_SLOT, BuyOrSellMenuConfig.INFORMATION_ITEM);
// sell item
shopInventory.setItem(BuyOrSellMenuConfig.SELL_SLOT, BuyOrSellMenuConfig.SELL_ITEM);
// buy item
shopInventory.setItem(BuyOrSellMenuConfig.BUY_SLOT, buyItemStack);
player.openInventory(shopInventory);
}
Aggregations