use of com.ebicep.warlords.util.bukkit.ItemBuilder in project Warlords by ebicep.
the class DebugMenuGameOptions method openMapsMenu.
public static void openMapsMenu(Player player) {
Menu menu = new Menu("Map Picker", 9 * 5);
GameMap[] values = GameMap.values();
for (int i = 0; i < values.length; i++) {
GameMap map = values[i];
String mapName = map.getMapName();
menu.setItem(i % 7 + 1, 1 + i / 7, new ItemBuilder(woolSortedByColor[i + 5]).name(ChatColor.GREEN + mapName).lore(ChatColor.GRAY + "Available Gamemodes: " + ChatColor.GOLD + map.getCategories().stream().map(gameMode -> gameMode.name).collect(Collectors.joining(", "))).get(), (m, e) -> openMapsCategoryMenu(player, map));
}
menu.setItem(3, 4, MENU_BACK, (m, e) -> openGameMenu(player));
menu.setItem(4, 4, 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 openTimerMenu.
public static void openTimerMenu(Player player, Game game) {
TimerDebugAble timerDebugAble = (TimerDebugAble) game.getState();
Menu menu = new Menu("Timer", 9 * 4);
menu.setItem(2, 1, new ItemBuilder(Material.WOOD_BUTTON).name(ChatColor.GREEN + "Reset").get(), (m, e) -> timerDebugAble.resetTimer());
menu.setItem(4, 1, new ItemBuilder(Material.STONE_BUTTON).name(ChatColor.GREEN + "Skip").get(), (m, e) -> timerDebugAble.skipTimer());
menu.setItem(6, 1, new ItemBuilder(Material.WATCH).name(ChatColor.GREEN + "Set").get(), (m, e) -> {
for (Option option : game.getOptions()) {
if (option instanceof WinAfterTimeoutOption) {
int timeLeft = ((WinAfterTimeoutOption) option).getTimeRemaining();
openTimerSetMenu(player, game, timeLeft / 60, timeLeft % 60);
break;
}
}
});
menu.setItem(3, 3, MENU_BACK, (m, e) -> openGameEditorMenu(player, game));
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 openGameSelectMenu.
public static void openGameSelectMenu(Player player) {
Menu menu = new Menu("Game Selector", 9 * 5);
List<Game> games = Warlords.getGameManager().getGames().stream().map(GameManager.GameHolder::getGame).filter(Objects::nonNull).collect(Collectors.toList());
int x = 1;
int y = 1;
for (Game game : games) {
ItemBuilder itemBuilder = new ItemBuilder(Material.BOOK).name(ChatColor.GREEN + "Game - " + game.getGameId()).lore(ChatColor.DARK_GRAY + "Map - " + ChatColor.RED + game.getMap().getMapName(), ChatColor.DARK_GRAY + "GameMode - " + ChatColor.RED + game.getGameMode(), ChatColor.DARK_GRAY + "Addons - " + ChatColor.RED + game.getAddons(), ChatColor.DARK_GRAY + "Players - " + ChatColor.RED + game.playersCount());
if (Warlords.getPlayer(player) != null && Warlords.getPlayer(player).getGame() == game) {
itemBuilder.enchant(Enchantment.OXYGEN, 1);
itemBuilder.flags(ItemFlag.HIDE_ENCHANTS);
}
menu.setItem(x, y, itemBuilder.get(), (m, e) -> openGameEditorMenu(player, game));
x++;
if (x == 7) {
x = 1;
y++;
}
}
menu.setItem(3, 4, MENU_BACK, (m, e) -> openGameMenu(player));
menu.setItem(4, 4, MENU_CLOSE, ACTION_CLOSE_MENU);
menu.openForPlayer(player);
}
use of com.ebicep.warlords.util.bukkit.ItemBuilder in project Warlords by ebicep.
the class DebugMenuPlayerOptions method openSkillBoostMenu.
public static void openSkillBoostMenu(Player player, WarlordsPlayer target, Classes selectedClass) {
Menu menu = new Menu("Skill Boost: " + target.getName(), 9 * 4);
List<ClassesSkillBoosts> values = selectedClass.skillBoosts;
for (int i = 0; i < values.size(); i++) {
ClassesSkillBoosts skillBoost = values.get(i);
menu.setItem(i + 2, 1, new ItemBuilder(selectedClass.specType.itemStack).name(ChatColor.RED + skillBoost.name + " (" + selectedClass.name + ")").lore(skillBoost.description, "", ChatColor.YELLOW + "Click to select!").get(), (m, e) -> {
setSelectedBoost(Bukkit.getPlayer(target.getUuid()), skillBoost);
target.setSpec(selectedClass.create.get(), skillBoost);
target.getGameState().updatePlayerName(target);
player.sendMessage(ChatColor.RED + "DEV: " + target.getColoredName() + "'s §aspec was changed to " + selectedClass.name);
openSpecMenu(player, target);
});
}
menu.setItem(3, 3, MENU_BACK, (m, e) -> openSpecMenu(player, target));
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 DebugMenuPlayerOptions method openFlagMultiplierMenu.
public static void openFlagMultiplierMenu(Player player, WarlordsPlayer target) {
Menu menu = new Menu("Flag Multiplier: " + target.getName(), 9 * 4);
int[] multipliers = { 5, 10, 30, 60, 100, 150, 300 };
for (int i = 0; i < 7; i++) {
int finalI = i;
menu.setItem(i + 1, 1, new ItemBuilder(woolSortedByColor[i + 5]).name(ChatColor.GREEN.toString() + multipliers[i]).get(), (m, e) -> {
int amount = e.isLeftClick() ? multipliers[finalI] : -multipliers[finalI];
if (target.getCarriedFlag() != null) {
PlayerFlagLocation redFlag = ((PlayerFlagLocation) target.getCarriedFlag().getFlag());
if (redFlag.getPickUpTicks() + (60 * amount) < 0) {
amount = -redFlag.getPickUpTicks() / 60;
}
redFlag.addPickUpTicks(60 * amount);
player.sendMessage(ChatColor.RED + "DEV: §aThe blue flag carrier gained " + amount + "%");
}
});
}
menu.setItem(3, 3, MENU_BACK, (m, e) -> openFlagOptionMenu(player, target));
menu.setItem(4, 3, MENU_CLOSE, ACTION_CLOSE_MENU);
menu.openForPlayer(player);
}
Aggregations