use of com.ebicep.warlords.util.bukkit.ItemBuilder in project Warlords by ebicep.
the class DebugMenuGameOptions method openMapsCategoryMenu.
public static void openMapsCategoryMenu(Player player, GameMap selectedGameMap) {
int menuHeight = (4 + selectedGameMap.getCategories().size() / 7);
Menu menu = new Menu(selectedGameMap.getMapName(), 9 * menuHeight);
for (int i = 0; i < selectedGameMap.getCategories().size(); i++) {
GameMode gameMode = selectedGameMap.getCategories().get(i);
menu.setItem(i % 7 + 1, 1 + i / 7, new ItemBuilder(woolSortedByColor[i + 5]).name(ChatColor.GREEN + gameMode.name).get(), (m, e) -> {
List<GameAddon> addons = new ArrayList<>();
addons.add(GameAddon.PRIVATE_GAME);
addons.add(GameAddon.CUSTOM_GAME);
openMapsAddonsMenu(player, selectedGameMap, gameMode, addons);
});
}
menu.setItem(3, menuHeight - 1, MENU_BACK, (m, e) -> openMapsMenu(player));
menu.setItem(4, menuHeight - 1, MENU_CLOSE, ACTION_CLOSE_MENU);
menu.openForPlayer(player);
}
use of com.ebicep.warlords.util.bukkit.ItemBuilder in project Warlords by ebicep.
the class DebugMenuGameOptions method openGameMenu.
public static void openGameMenu(Player player) {
Menu menu = new Menu("Game Options", 9 * 4);
ItemStack[] itemStack = { new ItemBuilder(Material.DARK_OAK_DOOR_ITEM).name(ChatColor.GREEN + "Start").get(), new ItemBuilder(Material.BOOK).name(ChatColor.GREEN + "Games").get() // new ItemBuilder(Material.ICE)
// .name(ChatColor.GREEN + "Freeze Game")
// .get(),
};
for (int i = 0; i < itemStack.length; i++) {
int index = i + 1;
menu.setItem(index, 1, itemStack[i], (m, e) -> {
switch(index) {
case 1:
openMapsMenu(player);
break;
case 2:
openGameSelectMenu(player);
break;
}
});
}
menu.setItem(3, 3, MENU_BACK, (m, e) -> DebugMenu.openDebugMenu(player));
menu.setItem(4, 3, MENU_CLOSE, ACTION_CLOSE_MENU);
menu.openForPlayer(player);
}
use of com.ebicep.warlords.util.bukkit.ItemBuilder in project Warlords by ebicep.
the class DebugMenuGameOptions method openGameEditorMenu.
public static void openGameEditorMenu(Player player, Game game) {
Menu menu = new Menu("Game Editor", 9 * 4);
menu.setItem(1, 1, new ItemBuilder(Material.DIODE).name(ChatColor.GREEN + "Timer").get(), (m, e) -> openTimerMenu(player, game));
menu.setItem(2, 1, new ItemBuilder(Material.SIGN).name(ChatColor.GREEN + "Edit Team Scores").get(), (m, e) -> openTeamScoreEditorMenu(player, game));
menu.setItem(3, 1, new ItemBuilder(Material.ICE).name(ChatColor.GREEN + "Freeze Game").get(), (m, e) -> {
if (game.isFrozen()) {
game.removeFrozenCause("Debug");
} else {
game.addFrozenCause("Debug");
}
});
menu.setItem(3, 3, MENU_BACK, (m, e) -> openGameSelectMenu(player));
menu.setItem(4, 3, MENU_CLOSE, ACTION_CLOSE_MENU);
menu.openForPlayer(player);
}
use of com.ebicep.warlords.util.bukkit.ItemBuilder in project Warlords by ebicep.
the class DebugMenuGameOptions method openScoreEditorMenu.
public static void openScoreEditorMenu(Player player, Game game, Team team, int points) {
Menu menu = new Menu("Score Editor", 9 * 4);
menu.setItem(1, 1, new ItemBuilder(team.item).name(team.teamColor + team.name + " - " + points).lore(ChatColor.YELLOW + "Left-Click to ADD" + "\n" + "Right-Click to SUBTRACT").get(), (m, e) -> {
});
menu.setItem(2, 1, new ItemBuilder(Material.LEVER).name(ChatColor.GREEN + "1").get(), (m, e) -> openScoreEditorMenu(player, game, team, points + (e.isLeftClick() ? 1 : -1)));
menu.setItem(3, 1, new ItemBuilder(Material.LEVER).name(ChatColor.GREEN + "5").get(), (m, e) -> openScoreEditorMenu(player, game, team, points + (e.isLeftClick() ? 5 : -5)));
menu.setItem(4, 1, new ItemBuilder(Material.LEVER).name(ChatColor.GREEN + "10").get(), (m, e) -> openScoreEditorMenu(player, game, team, points + (e.isLeftClick() ? 10 : -10)));
menu.setItem(5, 1, new ItemBuilder(Material.LEVER).name(ChatColor.GREEN + "25").get(), (m, e) -> openScoreEditorMenu(player, game, team, points + (e.isLeftClick() ? 25 : -25)));
menu.setItem(6, 1, new ItemBuilder(Material.LEVER).name(ChatColor.GREEN + "250").get(), (m, e) -> openScoreEditorMenu(player, game, team, points + (e.isLeftClick() ? 250 : -250)));
menu.setItem(3, 3, MENU_BACK, (m, e) -> openTeamScoreEditorMenu(player, game));
menu.setItem(4, 3, MENU_CLOSE, ACTION_CLOSE_MENU);
menu.setItem(5, 3, new ItemBuilder(Material.WOOL, 1, (byte) 5).name(ChatColor.GREEN + "Set Score - " + points).get(), (m, e) -> game.setPoints(team, points));
menu.openForPlayer(player);
}
use of com.ebicep.warlords.util.bukkit.ItemBuilder in project Warlords by ebicep.
the class DebugMenuPlayerOptions method openAmountMenu.
public static void openAmountMenu(Player player, WarlordsPlayer target, String commandType) {
String targetName = target != null ? target.getName() : "";
String commandName = commandType.equals("heal") ? "Give Health" : "Take Damage";
Menu menu = new Menu(commandName + ": " + (target != null ? targetName : player.getName()), 9 * 4);
for (int i = 1; i <= 5; i++) {
int amount = i * 1000;
menu.setItem(i + 1, 1, new ItemBuilder(woolSortedByColor[i - 1]).name((commandType.equals("takedamage") ? ChatColor.RED.toString() : ChatColor.GREEN.toString()) + amount).get(), (m, e) -> Bukkit.getServer().dispatchCommand(player, "wl " + commandType + " " + amount + " " + targetName));
}
menu.setItem(3, 3, MENU_BACK, (m, e) -> openPlayerMenu(player, target));
menu.setItem(4, 3, MENU_CLOSE, ACTION_CLOSE_MENU);
menu.openForPlayer(player);
}
Aggregations