use of me.RockinChaos.itemjoin.utils.interfaces.Interface in project ItemJoin by RockinChaos.
the class Menu method modelDataPane.
/**
* Opens the Pane for the Player.
* This Pane is for an items model data.
*
* @param player - The Player to have the Pane opened.
* @param itemMap - The ItemMap currently being modified.
*/
private static void modelDataPane(final Player player, final ItemMap itemMap) {
Interface texturePane = new Interface(true, 6, GUIName, player);
SchedulerUtils.runAsync(() -> {
texturePane.setReturnButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item definition menu."), event -> {
dataPane(player, itemMap);
}));
texturePane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "YELLOW_STAINED_GLASS_PANE" : "STAINED_GLASS_PANE:4"), 1, false, "&e&lCustom Model Data", "&7", "&7*Click to set the custom mode data", "&7value for the item."), event -> {
player.closeInventory();
String[] placeHolders = LanguageAPI.getLang(false).newString();
placeHolders[16] = "MODEL DATA";
placeHolders[15] = "1193";
LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputType", player, placeHolders);
LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputExample", player, placeHolders);
}, event -> {
if (StringUtils.isInt(ChatColor.stripColor(event.getMessage()))) {
itemMap.setModelData(Integer.parseInt(ChatColor.stripColor(event.getMessage())));
String[] placeHolders = LanguageAPI.getLang(false).newString();
placeHolders[16] = "MODEL DATA";
LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputSet", player, placeHolders);
} else {
String[] placeHolders = LanguageAPI.getLang(false).newString();
placeHolders[16] = ChatColor.stripColor(event.getMessage());
LanguageAPI.getLang(false).sendLangMessage("commands.menu.noInteger", player, placeHolders);
}
dataPane(event.getPlayer(), itemMap);
}));
for (int i = 1; i <= 2000; i++) {
final int k = i;
texturePane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "PINK_STAINED_GLASS_PANE" : "STAINED_GLASS_PANE:6"), 1, false, "&9&lModel Data: &a&l" + k, "&7", "&7*Click to set the", "&7custom model data for the item."), event -> {
itemMap.setModelData(k);
dataPane(player, itemMap);
}));
}
});
texturePane.open(player);
}
use of me.RockinChaos.itemjoin.utils.interfaces.Interface in project ItemJoin by RockinChaos.
the class Menu method animateMaterialPane.
// ============================================== //
// Animation Definition Menus //
// ============================================== //
/**
* Opens the Pane for the Player.
* This Pane is for modifying animated material.
*
* @param player - The Player to have the Pane opened.
* @param itemMap - The ItemMap currently being modified.
*/
private static void animateMaterialPane(final Player player, final ItemMap itemMap) {
Interface animateMaterialPane = new Interface(true, 2, GUIName, player);
SchedulerUtils.runAsync(() -> {
animateMaterialPane.setReturnButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the animation menu."), event -> {
if (!itemMap.getDynamicMaterials().isEmpty()) {
itemMap.setAnimate(true);
if (ItemHandler.cutDelay(itemMap.getDynamicMaterials().get(0)).contains(":")) {
String[] material = ItemHandler.cutDelay(itemMap.getDynamicMaterials().get(0)).split(":");
itemMap.setMaterial(ItemHandler.getMaterial(material[0], null));
itemMap.setDataValue((short) Integer.parseInt(material[1]));
} else {
itemMap.setMaterial(ItemHandler.getMaterial(ItemHandler.cutDelay(itemMap.getDynamicMaterials().get(0)), null));
}
}
animationPane(player, itemMap);
}));
animateMaterialPane.addButton(new Button(ItemHandler.getItem("FEATHER", 1, true, "&eNew Material", "&7", "&7*Add a new material", "&7to be animated between."), event -> selectMaterialPane(player, itemMap, 0, true)));
for (int i = 1; i <= itemMap.getDynamicMaterials().size(); i++) {
final int k = i;
animateMaterialPane.addButton(new Button(ItemHandler.getItem(ItemHandler.cutDelay(itemMap.getDynamicMaterials().get(k - 1)), 1, false, "&fMaterial " + k, "&7", "&7*Click modify this animated material.", "&9&lAnimation Ticks: &a" + StringUtils.returnInteger(ItemHandler.getDelayFormat(itemMap.getDynamicMaterials().get(k - 1)))), event -> modifyMaterialPane(player, itemMap, k - 1)));
}
});
animateMaterialPane.open(player);
}
use of me.RockinChaos.itemjoin.utils.interfaces.Interface in project ItemJoin by RockinChaos.
the class Menu method limitPane.
// ===========================================================================================================================================================================================================================================================
/**
* Opens the Pane for the Player.
* This Pane is for setting the Limit Gamemodes.
*
* @param player - The Player to have the Pane opened.
* @param itemMap - The ItemMap currently being modified.
*/
private static void limitPane(final Player player, final ItemMap itemMap) {
Interface limitPane = new Interface(false, 2, GUIName, player);
SchedulerUtils.runAsync(() -> {
List<String> limitModes = new ArrayList<String>();
if (StringUtils.containsIgnoreCase(itemMap.getLimitModes(), "ADVENTURE")) {
limitModes.add("ADVENTURE");
}
if (StringUtils.containsIgnoreCase(itemMap.getLimitModes(), "SURVIVAL")) {
limitModes.add("SURVIVAL");
}
if (StringUtils.containsIgnoreCase(itemMap.getLimitModes(), "CREATIVE")) {
limitModes.add("CREATIVE");
}
limitPane.addButton(new Button(fillerPaneGItem), 3);
limitPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "FILLED_MAP" : "MAP"), 1, limitModes.contains("ADVENTURE"), "&a&l&nADVENTURE", "&7", "&7*Limits the item to ADVENTURE mode.", "&9&lENABLED: &a" + (limitModes.contains("ADVENTURE") + "").toUpperCase()), event -> {
if (limitModes.contains("ADVENTURE")) {
limitModes.remove("ADVENTURE");
} else {
limitModes.add("ADVENTURE");
}
itemMap.setLimitModes(limitModes.toString().substring(0, limitModes.toString().length() - 1).substring(1));
limitPane(player, itemMap);
}));
limitPane.addButton(new Button(ItemHandler.getItem("STONE_SWORD", 1, limitModes.contains("SURVIVAL"), "&b&l&nSURVIVAL", "&7", "&7*Limits the item to SURVIVAL mode.", "&9&lENABLED: &a" + (limitModes.contains("SURVIVAL") + "").toUpperCase()), event -> {
if (limitModes.contains("SURVIVAL")) {
limitModes.remove("SURVIVAL");
} else {
limitModes.add("SURVIVAL");
}
itemMap.setLimitModes(limitModes.toString().substring(0, limitModes.toString().length() - 1).substring(1));
limitPane(player, itemMap);
}));
limitPane.addButton(new Button(ItemHandler.getItem(limitModes.contains("CREATIVE") ? (ServerUtils.hasSpecificUpdate("1_13") ? "ENCHANTED_GOLDEN_APPLE" : "322:1") : "GOLDEN_APPLE", 1, false, "&6&l&nCREATIVE", "&7", "&7*Limits the item to CREATIVE mode.", "&9&lENABLED: &a" + (limitModes.contains("CREATIVE") + "").toUpperCase()), event -> {
if (limitModes.contains("CREATIVE")) {
limitModes.remove("CREATIVE");
} else {
limitModes.add("CREATIVE");
}
itemMap.setLimitModes(limitModes.toString().substring(0, limitModes.toString().length() - 1).substring(1));
limitPane(player, itemMap);
}));
limitPane.addButton(new Button(fillerPaneGItem), 3);
limitPane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item definition menu."), event -> creatingPane(player, itemMap)));
limitPane.addButton(new Button(fillerPaneBItem), 7);
limitPane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item definition menu."), event -> creatingPane(player, itemMap)));
});
limitPane.open(player);
}
use of me.RockinChaos.itemjoin.utils.interfaces.Interface in project ItemJoin by RockinChaos.
the class Menu method conditionsPane.
/**
* Opens the Pane for the Player.
* This Pane is for setting the item conditions.
*
* @param player - The Player to have the Pane opened.
* @param itemMap - The ItemMap currently being modified.
*/
private static void conditionsPane(final Player player, final ItemMap itemMap) {
Interface conditionsPane = new Interface(false, 2, GUIName, player);
SchedulerUtils.runAsync(() -> {
conditionsPane.addButton(new Button(fillerPaneBItem), 3);
conditionsPane.addButton(new Button(ItemHandler.getItem("BOOK", 1, false, "&b&l&nCommand&b&l Conditions", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: " + String.valueOf((StringUtils.nullCheck(itemMap.getCommandConditions() + "") != "NONE")).toUpperCase()), event -> commandActionPane(player, itemMap)));
conditionsPane.addButton(new Button(ItemHandler.getItem("CACTUS", 1, false, "&b&l&nDisposable&b&l Conditions", "&7", "&7*Condition(s) that must be met", "&7in order for the disposable", "&7itemflag to function.", "&7", "&c&l&nNOTE:&7 The disposable itemflag", "&7must be defined for this", "&7condition to function.", "&7", "&9&lENABLED: " + String.valueOf((StringUtils.nullCheck(itemMap.getDisposableConditions() + "") != "NONE")).toUpperCase()), event -> disposableCPane(player, itemMap)));
conditionsPane.addButton(new Button(ItemHandler.getItem("REDSTONE", 1, false, "&b&l&nTrigger&b&l Conditions", "&7", "&7*Condition(s) that must be met", "&7in order to to receive the", "&7item when performing a trigger.", "&7", "&9&lENABLED: " + String.valueOf((StringUtils.nullCheck(itemMap.getTriggerConditions() + "") != "NONE")).toUpperCase()), event -> triggerCPane(player, itemMap)));
conditionsPane.addButton(new Button(fillerPaneBItem), 3);
conditionsPane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item definition menu."), event -> creatingPane(player, itemMap)));
conditionsPane.addButton(new Button(fillerPaneBItem), 7);
conditionsPane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item definition menu."), event -> creatingPane(player, itemMap)));
});
conditionsPane.open(player);
}
use of me.RockinChaos.itemjoin.utils.interfaces.Interface in project ItemJoin by RockinChaos.
the class Menu method togglePane.
/**
* Opens the Pane for the Player.
* This Pane is for setting the custom toggle commands.
*
* @param player - The Player to have the Pane opened.
* @param itemMap - The ItemMap currently being modified.
*/
private static void togglePane(final Player player, final ItemMap itemMap) {
Interface togglePane = new Interface(false, 2, GUIName, player);
SchedulerUtils.runAsync(() -> {
togglePane.addButton(new Button(fillerPaneBItem), 2);
togglePane.addButton(new Button(ItemHandler.getItem("BOOK", 1, false, "&e&lCommands", "&7", "&7*Define specific commands which", "&7players can use to enable or disable", "&7the custom item upon execution."), event -> altCommandPane(player, itemMap, 0)));
togglePane.addButton(new Button(fillerPaneBItem));
togglePane.addButton(new Button(ItemHandler.getItem("PAPER", 1, (StringUtils.nullCheck(itemMap.getToggleMessage()) != "NONE"), "&b&lMessage", "&7", "&7*Set a custom message that", "&7will be sent to the player", "&7upon executing a toggle command.", "&9&lMESSAGE: &f" + StringUtils.nullCheck(itemMap.getToggleMessage())), event -> {
if (StringUtils.nullCheck(itemMap.getToggleMessage()) != "NONE") {
itemMap.setToggleMessage(null);
togglePane(player, itemMap);
} else {
player.closeInventory();
String[] placeHolders = LanguageAPI.getLang(false).newString();
placeHolders[16] = "TOGGLE MESSAGE";
placeHolders[15] = "&a%item% has been toggled!";
LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputType", player, placeHolders);
LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputExample", player, placeHolders);
}
}, event -> {
itemMap.setToggleMessage(ChatColor.stripColor(event.getMessage()));
String[] placeHolders = LanguageAPI.getLang(false).newString();
placeHolders[16] = "TOGGLE MESSAGE";
LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputSet", player, placeHolders);
togglePane(event.getPlayer(), itemMap);
}));
togglePane.addButton(new Button(fillerPaneBItem));
togglePane.addButton(new Button(ItemHandler.getItem("NAME_TAG", 1, (StringUtils.nullCheck(itemMap.getToggleNode()) != "NONE"), "&b&lPermissions", "&7", "&7*Set a custom permissions node", "&7that each player needs in order", "&7to execute the toggle commands.", "&9&lPERMISSIONS: &f" + StringUtils.nullCheck(itemMap.getToggleNode())), event -> {
if (StringUtils.nullCheck(itemMap.getToggleNode()) != "NONE") {
itemMap.setTogglePerm(null);
togglePane(player, itemMap);
} else {
player.closeInventory();
String[] placeHolders = LanguageAPI.getLang(false).newString();
placeHolders[16] = "TOGGLE PERMISSION";
placeHolders[15] = "itemjoin.toggle";
LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputType", player, placeHolders);
LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputExample", player, placeHolders);
}
}, event -> {
itemMap.setTogglePerm(ChatColor.stripColor(event.getMessage()));
String[] placeHolders = LanguageAPI.getLang(false).newString();
placeHolders[16] = "TOGGLE PERMISSION";
LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputSet", player, placeHolders);
togglePane(event.getPlayer(), itemMap);
}));
togglePane.addButton(new Button(fillerPaneBItem), 2);
togglePane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item definition menu."), event -> creatingPane(player, itemMap)));
togglePane.addButton(new Button(fillerPaneBItem), 7);
togglePane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item definition menu."), event -> creatingPane(player, itemMap)));
});
togglePane.open(player);
}
Aggregations