use of fr.minuskube.inv.SmartInventory in project Nexus by ProjectEdenGG.
the class AchievementProvider method open.
public static void open(Player player) {
SmartInventory inv = SmartInventory.builder().provider(new AchievementGroupProvider()).size((int) ((Math.ceil(AchievementGroup.values().length / 9)) + 2), 9).title(colorize("&3Achievements")).build();
inv.open(player);
}
use of fr.minuskube.inv.SmartInventory in project Nexus by ProjectEdenGG.
the class CombinationLockProvider method parseCode.
public void parseCode(Player player, InventoryContents contents) {
int[][] groups = { { 0, 1, 2 }, { 3, 4, 5 }, { 6, 7, 8 } };
boolean[] correct = { false, false, false };
for (int i = 0; i < groups.length; i++) {
if (!isNullOrEmpty(playerCode) && playerCode.length() == CORRECT_CODE.length())
for (int j = 0; j < groups[i].length; j++) if (playerCode.charAt(groups[i][j]) == CORRECT_CODE.charAt(groups[i][j]))
correct[i] = true;
else {
correct[i] = false;
break;
}
for (int j = 0; j < groups[i].length; j++) {
Material mat = correct[i] ? Material.LIME_STAINED_GLASS_PANE : Material.RED_STAINED_GLASS_PANE;
contents.set(4, groups[i][j], ClickableItem.empty(new ItemBuilder(mat).name(" ").build()));
}
}
Tasks.wait(TickTime.SECOND.x(5), () -> {
if (correct[0] && correct[1] && correct[2])
complete(player);
else {
SmartInventory inv = SmartInvsPlugin.manager().getInventory(player).orElse(null);
if (inv != null && inv.getProvider() == this)
Halloween20Menus.openComboLock(player);
}
});
}
use of fr.minuskube.inv.SmartInventory in project Nexus by ProjectEdenGG.
the class ItemEditorMenu method openItemEditor.
public static void openItemEditor(Player player, ItemEditMenu menu) {
SmartInventory inv = SmartInventory.builder().provider(new ItemEditorProvider(menu)).size(menu.getSize(), 9).title("Customize Item").build();
inv.open(player);
}
use of fr.minuskube.inv.SmartInventory in project Nexus by ProjectEdenGG.
the class TeamMenus method openTeamsEditorMenu.
public void openTeamsEditorMenu(Player player, Arena arena, Team team) {
SmartInventory INV = SmartInventory.builder().id("teamEditorMenu").title("Team Editor Menu").provider(new TeamEditorMenu(arena, team)).size(3, 9).build();
INV.open(player);
}
use of fr.minuskube.inv.SmartInventory in project Nexus by ProjectEdenGG.
the class TeamMenus method openDeleteTeamMenu.
public void openDeleteTeamMenu(Player player, Arena arena, Team team) {
SmartInventory INV = SmartInventory.builder().id("teamDeleteMenu").title("Delete Team?").provider(new DeleteTeamMenu(arena, team)).size(3, 9).build();
INV.open(player);
}
Aggregations