Here are the examples of the java api org.bukkit.Bukkit.createInventory() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
150 Examples
18
Source : UI.java
with Apache License 2.0
from UnknownStudio
with Apache License 2.0
from UnknownStudio
/**
* create an inventory
*/
public Inventory buildInventory() {
Inventory inventory = Bukkit.createInventory(null, size, getreplacedle());
inventory.setContents(buildContent());
return inventory;
}
18
Source : VersionedInventory.java
with MIT License
from PXAV
with MIT License
from PXAV
@Override
public Inventory createInventory(int size, String replacedle) {
return Bukkit.createInventory(null, size, replacedle);
}
18
Source : ExtraBackpackGUI.java
with MIT License
from NyaaCat
with MIT License
from NyaaCat
private ExtraBackpackInventory getInventory(UUID owner) {
String ownerId = owner.toString();
queryConfig(owner);
if (maxLine <= 0) {
return null;
}
// Inventory inventory = Bukkit.createInventory(this, size, I18n.format("user.backpack.replacedle", Bukkit.getOfflinePlayer(owner).getName(), page, pageCount - 1));
List<ExtraBackpackLine> lines;
lines = queryLines(owner);
ExtraBackpackInventory inv = new ExtraBackpackInventory(this);
int pageCount = (int) Math.ceil(maxLine / 6.0);
inv.size = lines.size();
for (int page = 0; page < pageCount; page++) {
long size = lines.stream().skip(page * 6).limit(6).count();
String replacedle = getInventoryreplacedle(page);
Inventory inventory = Bukkit.createInventory(this, (int) size * 9, replacedle);
List<ExtraBackpackLine> view = lines.stream().skip(page * 6).limit(6).collect(Collectors.toList());
ItemStack[] itemStacks = view.stream().flatMap(l -> l.gereplacedemStacks().stream()).toArray(ItemStack[]::new);
inventory.setContents(itemStacks);
inv.inventories.add(page, inventory);
}
return inv;
}
17
Source : WauzCitizenInteractions.java
with Apache License 2.0
from Wauzmons
with Apache License 2.0
from Wauzmons
/**
* Creates an inventory menu, containing all interaction item stacks.
*
* @param holder The holder of the inventory menu.
* @param replacedle The replacedle of the menu.
*
* @return The created inventory menu.
*/
public Inventory createInteractionMenuBase(InventoryHolder holder, String replacedle) {
int size = (int) Math.ceil((double) interactionItemStacks.size() / (double) 5) * 9;
Inventory menu = Bukkit.createInventory(holder, size, replacedle);
int row = 0;
int column = 0;
for (ItemStack interactionItemStack : interactionItemStacks) {
if (column >= 5) {
row++;
column = 0;
}
int index = column + 2 + (row * 9);
menu.sereplacedem(index, interactionItemStack);
column++;
}
return menu;
}
17
Source : UI.java
with Apache License 2.0
from UnknownStudio
with Apache License 2.0
from UnknownStudio
/**
* create an inventory with certain players info
*/
public Inventory buildInventory(Player player) {
Inventory inventory = Bukkit.createInventory(player, size, getreplacedle(player));
inventory.setContents(buildContent());
return inventory;
}
17
Source : MenuBuilder.java
with MIT License
from TabooLib
with MIT License
from TabooLib
/**
* 构建菜单
*
* @return Bukkit 的 Inventory 背包对象实例
*/
public Inventory build() {
Inventory inventory = Bukkit.createInventory(new MenuHolder(this), rows, String.valueOf(replacedle));
for (int i = 0; i < items.length && i < rows; i++) {
char[] line = items[i];
for (int j = 0; j < line.length && j < 9; j++) {
inventory.sereplacedem(i * 9 + j, keys.getOrDefault(line[j], new ItemStack(Material.AIR)));
}
}
return inventory;
}
17
Source : StonecutterGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory(@NotNull String replacedle) {
return Bukkit.createInventory(this, InventoryType.STONECUTTER, replacedle);
}
17
Source : SmithingTableGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory(@NotNull String replacedle) {
return Bukkit.createInventory(this, InventoryType.SMITHING, replacedle);
}
17
Source : ShulkerBoxGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory(@NotNull String replacedle) {
return Bukkit.createInventory(this, InventoryType.SHULKER_BOX, replacedle);
}
17
Source : GrindstoneGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory(@NotNull String replacedle) {
return Bukkit.createInventory(this, InventoryType.GRINDSTONE, replacedle);
}
17
Source : EnderChestGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory(@NotNull String replacedle) {
return Bukkit.createInventory(this, InventoryType.ENDER_CHEST, replacedle);
}
17
Source : EnchantingTableGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory(@NotNull String replacedle) {
return Bukkit.createInventory(this, InventoryType.ENCHANTING, replacedle);
}
17
Source : ChestGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory(@NotNull String replacedle) {
return Bukkit.createInventory(this, getRows() * 9, replacedle);
}
17
Source : CartographyTableGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory(@NotNull String replacedle) {
return Bukkit.createInventory(this, InventoryType.CARTOGRAPHY, replacedle);
}
17
Source : BeaconGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory() {
return Bukkit.createInventory(this, InventoryType.BEACON);
}
17
Source : BarrelGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory(@NotNull String replacedle) {
return Bukkit.createInventory(this, InventoryType.BARREL, replacedle);
}
17
Source : OptionsRegistry.java
with GNU General Public License v3.0
from Plugily-Projects
with GNU General Public License v3.0
from Plugily-Projects
/**
* Creates inventory with all of registered menu options
*
* @return options inventory
*/
public Inventory formatInventory() {
Inventory inv = Bukkit.createInventory(null, inventorySize, plugin.getChatManager().colorMessage("Menus.Option-Menu.Inventory-Name"));
for (MenuOption option : registeredOptions) {
inv.sereplacedem(option.getSlot(), option.gereplacedemStack());
}
return inv;
}
17
Source : ChestPage.java
with GNU General Public License v3.0
from personinblack
with GNU General Public License v3.0
from personinblack
/**
* {@inheritDoc}
* @deprecated because this is against oop and we don't have a single universal inventory.
*/
@Override
@Deprecated
public Inventory getInventory() {
return Bukkit.createInventory(null, 9);
}
17
Source : ExtraBackpackGUI.java
with MIT License
from NyaaCat
with MIT License
from NyaaCat
@Override
@Nonnull
public Inventory getInventory() {
return Bukkit.createInventory(null, 54);
}
17
Source : ChestSortSettingsGUI.java
with GNU General Public License v3.0
from JEFF-Media-GbR
with GNU General Public License v3.0
from JEFF-Media-GbR
Inventory createGUI(String name, Player inventoryHolder) {
return Bukkit.createInventory(inventoryHolder, InventoryType.CHEST, name);
}
17
Source : GUI.java
with GNU Affero General Public License v3.0
from ClayCoffee
with GNU Affero General Public License v3.0
from ClayCoffee
public void show(final Player p) {
final Inventory pm = Bukkit.createInventory(new GUIHolder(this, p), size, replacedle);
this.menu.put(p.getUniqueId().toString(), pm);
setupMenu(pm, p);
final Player player = p;
new BukkitRunnable() {
public void run() {
player.closeInventory();
player.openInventory(pm);
}
}.runTask(ClayTech.getInstance());
}
17
Source : BlockGUI.java
with GNU Affero General Public License v3.0
from ClayCoffee
with GNU Affero General Public License v3.0
from ClayCoffee
public void show(final Player p) {
final Inventory pm = Bukkit.createInventory(new GUIHolder(this, p), size, replacedle);
this.menu.put(p.getUniqueId().toString(), pm);
setupBlockMenu(pm, p, this.block);
final Player player = p;
new BukkitRunnable() {
public void run() {
player.closeInventory();
player.openInventory(pm);
}
}.runTask(ClayTech.getInstance());
}
16
Source : Config.java
with MIT License
from TheBusyBiscuit
with MIT License
from TheBusyBiscuit
/**
* Gets the Contents of an Inventory at the specified path
*
* @param path
* The path in the Config File
* @param replacedle
* The replacedle of the inventory, this can accept & for color codes.
*
* @return The generated Inventory
*/
@Nonnull
public Inventory getInventory(@NonNull String path, @NonNull String replacedle) {
int size = getInt(path + ".size");
Inventory inventory = Bukkit.createInventory(null, size, ChatColor.translateAlternateColorCodes('&', replacedle));
for (int i = 0; i < size; i++) {
inventory.sereplacedem(i, gereplacedem(path + "." + i));
}
return inventory;
}
16
Source : Config.java
with MIT License
from TheBusyBiscuit
with MIT License
from TheBusyBiscuit
/**
* Gets the Contents of an Inventory at the specified path
*
* @param path
* The path in the Config File
* @param size
* The Size of the Inventory
* @param replacedle
* The replacedle of the Inventory
*
* @return The generated Inventory
*/
@Nonnull
public Inventory getInventory(@NonNull String path, int size, @NonNull String replacedle) {
Inventory inventory = Bukkit.createInventory(null, size, ChatColor.translateAlternateColorCodes('&', replacedle));
for (int i = 0; i < size; i++) {
inventory.sereplacedem(i, gereplacedem(path + "." + i));
}
return inventory;
}
16
Source : HeadInventory.java
with MIT License
from Thatsmusic99
with MIT License
from Thatsmusic99
public Inventory build(Player sender, List<ItemStack> list, String section, int page, int pages, boolean showTopMenu, boolean wideMenu) {
Inventory inventory = Bukkit.createInventory(null, getSize(), getreplacedle().replaceAll("\\{page}", String.valueOf(page + 1)).replaceAll("\\{pages}", list == null ? "" : String.valueOf(pages)).replace("{section}", section));
HeadsPlus hp = HeadsPlus.getInstance();
return inventory;
}
16
Source : HopperGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory(@NotNull String replacedle) {
Inventory inventory = Bukkit.createInventory(this, InventoryType.HOPPER, replacedle);
addInventory(inventory, this);
return inventory;
}
16
Source : FurnaceGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory(@NotNull String replacedle) {
Inventory inventory = Bukkit.createInventory(this, InventoryType.FURNACE, replacedle);
addInventory(inventory, this);
return inventory;
}
16
Source : DropperGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory(@NotNull String replacedle) {
Inventory inventory = Bukkit.createInventory(this, InventoryType.DROPPER, replacedle);
addInventory(inventory, this);
return inventory;
}
16
Source : AnvilGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory(@NotNull String replacedle) {
return Bukkit.createInventory(this, InventoryType.ANVIL, replacedle);
}
16
Source : Base64Util.java
with GNU General Public License v3.0
from SavageLabs
with GNU General Public License v3.0
from SavageLabs
public static String toBase64(ItemStack[] is, int size) {
Inventory inventory = Bukkit.createInventory(null, size);
inventory.setContents(is);
return toBase64(inventory);
}
16
Source : BaseUtils.java
with GNU General Public License v3.0
from SaberLLC
with GNU General Public License v3.0
from SaberLLC
public static String toBase64(ItemStack[] is, int size) {
Inventory inventory = Bukkit.createInventory(null, size);
inventory.setContents(is);
return toBase64(inventory, size);
}
16
Source : EmojiChatGui.java
with MIT License
from RadBuilder
with MIT License
from RadBuilder
/**
* Gets the emoji list gui {@link org.bukkit.inventory.Inventory} using the specified page number.
*
* @param page The page number to view (starts at 0).
* @return The emoji list gui {@link org.bukkit.inventory.Inventory} with the page specified.
*/
Inventory getInventory(int page) {
Inventory gui = Bukkit.createInventory(null, 54, ChatColor.DARK_AQUA + "Emoji List Page " + (page + 1));
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
List<String> keyList = new ArrayList<>(plugin.getEmojiHandler().getEmojis().keySet());
for (int inventoryPosition = 0, emojiMapPosition = page * 54; inventoryPosition < 54 && emojiMapPosition < keyList.size(); inventoryPosition++, emojiMapPosition++) {
if (inventoryPosition == 45 && page != 0) {
// Add a back button if they're not on the first page
addBackArrow(gui);
emojiMapPosition--;
} else if (emojiMapPosition == keyList.size() - 1) {
// On the last page, not full of items
addBackArrow(gui);
addItem(gui, keyList, emojiMapPosition);
} else if (inventoryPosition == 53 && emojiMapPosition != keyList.size() - 1) {
// Add a next button if they're not on the last page
addNextArrow(gui);
emojiMapPosition--;
} else {
// Add the emoji list item
addItem(gui, keyList, emojiMapPosition);
}
}
keyList.clear();
});
return gui;
}
16
Source : GuessTheBuildArena.java
with GNU General Public License v3.0
from Plugily-Projects
with GNU General Public License v3.0
from Plugily-Projects
private void openThemeSelectionInventoryToCurrentBuilder() {
if (currentBuilder == null)
return;
Random r = new Random();
Inventory inv = Bukkit.createInventory(null, 27, getPlugin().getChatManager().colorMessage("Menus.Guess-The-Build-Theme-Selector.Inventory-Name"));
inv.sereplacedem(11, new ItemBuilder(Material.PAPER).name(getPlugin().getChatManager().colorMessage("Menus.Guess-The-Build-Theme-Selector.Theme-Item-Name").replace("%theme%", getPlugin().getConfigPreferences().getThemes("Guess-The-Build_EASY").get(r.nextInt(getPlugin().getConfigPreferences().getThemes("Guess-The-Build_EASY").size())))).lore(getPlugin().getChatManager().colorMessage("Menus.Guess-The-Build-Theme-Selector.Theme-Item-Lore").replace("%difficulty%", getPlugin().getChatManager().colorMessage("Menus.Guess-The-Build-Theme-Selector.Difficulties.Easy")).replace("%points%", String.valueOf(1)).split(";")).build());
inv.sereplacedem(13, new ItemBuilder(Material.PAPER).name(getPlugin().getChatManager().colorMessage("Menus.Guess-The-Build-Theme-Selector.Theme-Item-Name").replace("%theme%", getPlugin().getConfigPreferences().getThemes("Guess-The-Build_MEDIUM").get(r.nextInt(getPlugin().getConfigPreferences().getThemes("Guess-The-Build_MEDIUM").size())))).lore(getPlugin().getChatManager().colorMessage("Menus.Guess-The-Build-Theme-Selector.Theme-Item-Lore").replace("%difficulty%", getPlugin().getChatManager().colorMessage("Menus.Guess-The-Build-Theme-Selector.Difficulties.Medium")).replace("%points%", String.valueOf(2)).split(";")).build());
inv.sereplacedem(15, new ItemBuilder(Material.PAPER).name(getPlugin().getChatManager().colorMessage("Menus.Guess-The-Build-Theme-Selector.Theme-Item-Name").replace("%theme%", getPlugin().getConfigPreferences().getThemes("Guess-The-Build_HARD").get(r.nextInt(getPlugin().getConfigPreferences().getThemes("Guess-The-Build_HARD").size())))).lore(getPlugin().getChatManager().colorMessage("Menus.Guess-The-Build-Theme-Selector.Theme-Item-Lore").replace("%difficulty%", getPlugin().getChatManager().colorMessage("Menus.Guess-The-Build-Theme-Selector.Difficulties.Hard")).replace("%points%", String.valueOf(3)).split(";")).build());
currentBuilder.openInventory(inv);
}
16
Source : CustomMenu.java
with GNU General Public License v3.0
from Multitallented
with GNU General Public License v3.0
from Multitallented
public Inventory createMenu(Civilian civilian) {
actions.put(civilian.getUuid(), new HashMap<>());
Inventory inventory = Bukkit.createInventory(null, this.size, Civs.NAME + getName());
HashMap<String, Integer> duplicateCount = new HashMap<>();
for (MenuIcon menuIcon : itemIndexes) {
for (Integer i : menuIcon.getIndex()) {
if (duplicateCount.containsKey(menuIcon.getKey())) {
duplicateCount.put(menuIcon.getKey(), duplicateCount.get(menuIcon.getKey()) + 1);
} else {
duplicateCount.put(menuIcon.getKey(), 0);
}
ItemStack itemStack = createItemStack(civilian, menuIcon, duplicateCount.get(menuIcon.getKey()));
if (itemStack.getType() != Material.AIR) {
inventory.sereplacedem(i, itemStack);
}
}
}
return inventory;
}
16
Source : ProceduralShopMenu.java
with GNU General Public License v3.0
from MagmaGuy
with GNU General Public License v3.0
from MagmaGuy
public static void shopConstructor(Player player) {
Inventory shopInventory = Bukkit.createInventory(player, 54, SHOP_NAME);
populateShop(shopInventory, player);
player.openInventory(shopInventory);
}
16
Source : CustomShopMenu.java
with GNU General Public License v3.0
from MagmaGuy
with GNU General Public License v3.0
from MagmaGuy
/**
* 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);
}
16
Source : BackupMenu.java
with MIT License
from danjono
with MIT License
from danjono
public Inventory showItems() {
Inventory inv = Bukkit.createInventory(staff, 54, InventoryName.BACKUP.getName());
Buttons buttons = new Buttons();
int item = 0;
int position = 0;
// If the backup file is invalid it will return null, we want to catch it here
try {
// Add items
for (int i = 0; i < mainInventory.length - 5; i++) {
if (mainInventory[item] != null) {
inv.sereplacedem(position, mainInventory[item]);
position++;
}
item++;
}
} catch (NullPointerException e) {
staff.sendMessage(MessageData.pluginName + MessageData.errorInventory);
return null;
}
item = 36;
position = 44;
// Add armour
if (armour != null) {
for (ItemStack itemStack : armour) {
inv.sereplacedem(position, itemStack);
position--;
}
} else {
for (int i = 36; i < mainInventory.length; i++) {
if (mainInventory[item] != null) {
inv.sereplacedem(position, mainInventory[item]);
position--;
}
item++;
}
}
// Add back button
inv.sereplacedem(46, buttons.inventoryMenuBackButton(MessageData.backButton, playerUUID, logType));
// Add teleport back button
if (location != null)
inv.sereplacedem(48, buttons.enderPearlButton(playerUUID, logType, timestamp, location));
// Add Enderchest icon
if (enderChestAvailable)
inv.sereplacedem(50, buttons.enderChestButton(playerUUID, logType, timestamp));
// Add health icon
inv.sereplacedem(51, buttons.healthButton(playerUUID, logType, health));
// Add hunger icon
inv.sereplacedem(52, buttons.hungerButton(playerUUID, logType, hunger, saturation));
// Add Experience Bottle
inv.sereplacedem(53, buttons.experiencePotion(playerUUID, logType, xp));
return inv;
}
16
Source : MobSelector.java
with Apache License 2.0
from CloudNetService
with Apache License 2.0
from CloudNetService
public Inventory create(MobConfig mobConfig, ServerMob mob) {
Inventory inventory = Bukkit.createInventory(null, mobConfig.getInventorySize(), ChatColor.translateAlternateColorCodes('&', mob.getDisplay() + NetworkUtils.SPACE_STRING));
for (Map.Entry<Integer, MobItemLayout> mobItem : mobConfig.getDefaulreplacedemInventory().entrySet()) {
inventory.sereplacedem(mobItem.getKey() - 1, transform(mobItem.getValue()));
}
return inventory;
}
15
Source : CurrencyMenu.java
with Apache License 2.0
from Wauzmons
with Apache License 2.0
from Wauzmons
/**
* Opens the menu for the given player.
* Shows all currencies, divided into categories / factions.
*
* @param player The player that should view the inventory.
*
* @see WauzCurrency#getCurrencyCategories()
* @see CurrencyMenu#setCurrencyCategoryDisplay(Inventory, Player, WauzCurrencyCategory, int)
* @see MenuUtils#setBorders(Inventory)
*/
public static void open(Player player) {
List<WauzCurrencyCategory> categories = WauzCurrency.getCurrencyCategories();
int inventorySize = MenuUtils.roundInventorySize(categories.size());
WauzInventoryHolder holder = new WauzInventoryHolder(new CurrencyMenu());
Inventory menu = Bukkit.createInventory(holder, inventorySize, ChatColor.BLACK + "" + ChatColor.BOLD + "Currencies");
for (int index = 0; index < categories.size(); index++) {
setCurrencyCategoryDisplay(menu, player, categories.get(index), index);
}
MenuUtils.setBorders(menu);
player.openInventory(menu);
}
15
Source : SmokerGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory(@NotNull String replacedle) {
return Bukkit.createInventory(this, InventoryType.SMOKER, replacedle);
}
15
Source : DispenserGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory(@NotNull String replacedle) {
Inventory inventory = Bukkit.createInventory(this, InventoryType.DISPENSER, replacedle);
addInventory(inventory, this);
return inventory;
}
15
Source : CraftingTableGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory(@NotNull String replacedle) {
return Bukkit.createInventory(this, InventoryType.WORKBENCH, replacedle);
}
15
Source : BrewingStandGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory(@NotNull String replacedle) {
Inventory inventory = Bukkit.createInventory(this, InventoryType.BREWING, replacedle);
addInventory(inventory, this);
return inventory;
}
15
Source : BlastFurnaceGui.java
with The Unlicense
from stefvanschie
with The Unlicense
from stefvanschie
@NotNull
@Contract(pure = true)
@Override
public Inventory createInventory(@NotNull String replacedle) {
return Bukkit.createInventory(this, InventoryType.BLAST_FURNACE, replacedle);
}
15
Source : ChooseGUI.java
with MIT License
from SkytAsul
with MIT License
from SkytAsul
public Inventory open(Player p) {
Inventory inv = Bukkit.createInventory(null, (int) Math.ceil(available.size() * 1.0 / 9.0) * 9, name());
for (int i = 0; i < available.size(); i++) {
inv.sereplacedem(i, gereplacedemStack(available.get(i)));
}
return p.openInventory(inv).getTopInventory();
}
15
Source : SkinsGUI.java
with GNU General Public License v3.0
from SkinsRestorer
with GNU General Public License v3.0
from SkinsRestorer
public Inventory getGUI(Player p, int page, Map<String, Object> skinsList) {
Inventory inventory = Bukkit.createInventory(p, 54, C.c(Locale.SKINSMENU_replacedLE_NEW).replace("%page", String.valueOf(page)));
ItemStack none = new GuiGlreplaced(GlreplacedType.NONE).gereplacedemStack();
ItemStack delete = new GuiGlreplaced(GlreplacedType.DELETE).gereplacedemStack();
ItemStack prev = new GuiGlreplaced(GlreplacedType.PREV).gereplacedemStack();
ItemStack next = new GuiGlreplaced(GlreplacedType.NEXT).gereplacedemStack();
// White Glreplaced line
inventory.sereplacedem(36, none);
inventory.sereplacedem(37, none);
inventory.sereplacedem(38, none);
inventory.sereplacedem(39, none);
inventory.sereplacedem(40, none);
inventory.sereplacedem(41, none);
inventory.sereplacedem(42, none);
inventory.sereplacedem(43, none);
inventory.sereplacedem(44, none);
// Empty place previous
inventory.sereplacedem(45, none);
inventory.sereplacedem(46, none);
inventory.sereplacedem(47, none);
// Middle button //remove skin
inventory.sereplacedem(48, delete);
inventory.sereplacedem(49, delete);
inventory.sereplacedem(50, delete);
// Empty place next
inventory.sereplacedem(53, none);
inventory.sereplacedem(52, none);
inventory.sereplacedem(51, none);
// If page is above 1, adding Previous Page button.
if (page > 1) {
inventory.sereplacedem(45, prev);
inventory.sereplacedem(46, prev);
inventory.sereplacedem(47, prev);
}
skinsList.forEach((name, property) -> {
if (name.chars().anyMatch(i -> Character.isLetter(i) && Character.isUpperCase(i))) {
this.srLogger.logAlways("[SkinsRestorer] ERROR: skin " + name + ".skin contains a Upper case! \nPlease rename the file name to a lower case!.");
return;
}
inventory.addItem(createSkull(name, property));
});
// If the page is not empty, adding Next Page button.
if (inventory.firstEmpty() == -1 || inventory.gereplacedem(26) != null && page < 999) {
inventory.sereplacedem(53, next);
inventory.sereplacedem(52, next);
inventory.sereplacedem(51, next);
}
return inventory;
}
15
Source : SpectatorSettingsMenu.java
with GNU General Public License v3.0
from Plugily-Projects
with GNU General Public License v3.0
from Plugily-Projects
private Inventory initInventory() {
Inventory inv = Bukkit.createInventory(null, 9 * 3, inventoryName);
ChatManager chatManager = plugin.getChatManager();
inv.sereplacedem(11, new ItemBuilder(Material.LEATHER_BOOTS).name(chatManager.colorRawMessage(speedOptionName + " I")).build());
inv.sereplacedem(12, new ItemBuilder(Material.CHAINMAIL_BOOTS).name(chatManager.colorRawMessage(speedOptionName + " II")).build());
inv.sereplacedem(13, new ItemBuilder(Material.IRON_BOOTS).name(chatManager.colorRawMessage(speedOptionName + " III")).build());
inv.sereplacedem(14, new ItemBuilder(XMaterial.GOLDEN_BOOTS.parseItem()).name(chatManager.colorRawMessage(speedOptionName + " IV")).build());
inv.sereplacedem(15, new ItemBuilder(Material.DIAMOND_BOOTS).name(chatManager.colorRawMessage(speedOptionName + " V")).build());
return inv;
}
15
Source : SpectatorSettingsMenu.java
with GNU General Public License v3.0
from Plugily-Projects
with GNU General Public License v3.0
from Plugily-Projects
private Inventory initInventory() {
Inventory inv = Bukkit.createInventory(null, 9 * 3, inventoryName);
ChatManager chatManager = JavaPlugin.getPlugin(Main.clreplaced).getChatManager();
inv.sereplacedem(11, new ItemBuilder(Material.LEATHER_BOOTS).name(chatManager.colorRawMessage(speedOptionName + " I")).build());
inv.sereplacedem(12, new ItemBuilder(Material.CHAINMAIL_BOOTS).name(chatManager.colorRawMessage(speedOptionName + " II")).build());
inv.sereplacedem(13, new ItemBuilder(Material.IRON_BOOTS).name(chatManager.colorRawMessage(speedOptionName + " III")).build());
inv.sereplacedem(14, new ItemBuilder(XMaterial.GOLDEN_BOOTS.parseItem()).name(chatManager.colorRawMessage(speedOptionName + " IV")).build());
inv.sereplacedem(15, new ItemBuilder(Material.DIAMOND_BOOTS).name(chatManager.colorRawMessage(speedOptionName + " V")).build());
return inv;
}
15
Source : InventoryMenu.java
with GNU Affero General Public License v3.0
from PGMDev
with GNU Affero General Public License v3.0
from PGMDev
/**
* Open a new window for the given player displaying the given contents
*/
private Inventory openWindow(Player player, ItemStack[] contents) {
closeWindow(player);
Inventory inv = Bukkit.createInventory(player, getInventorySize(), StringUtils.truncate(getTranslatedreplacedle(player), 32));
inv.setContents(contents);
player.openInventory(inv);
viewing.put(player, true);
return inv;
}
15
Source : GizmoUtils.java
with GNU Affero General Public License v3.0
from OvercastNetwork
with GNU Affero General Public License v3.0
from OvercastNetwork
public static void openMenu(Player player) {
Inventory inventory = Bukkit.createInventory(player, 18, ChatColor.RED + LobbyTranslations.get().t("gizmos", player));
inventory.sereplacedem(4, Utils.getGhastTear(player, RaindropsListener.raindrops.get(player)));
int i = 9;
for (Gizmo gizmo : Gizmos.gizmos) {
inventory.sereplacedem(i++, gizmo.gereplacedemStack(player));
}
player.openInventory(inventory);
}
See More Examples