use of me.RockinChaos.itemjoin.utils.interfaces.Interface in project ItemJoin by RockinChaos.
the class Menu method soundPane.
/**
* Opens the Pane for the Player.
* This Pane is for setting an items command sound.
*
* @param player - The Player to have the Pane opened.
* @param itemMap - The ItemMap currently being modified.
*/
private static void soundPane(final Player player, final ItemMap itemMap, final int stage) {
Interface soundPane = new Interface(true, 6, GUIName, player);
SchedulerUtils.runAsync(() -> {
if (stage != 3) {
soundPane.setReturnButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the teleport menu."), event -> teleportPane(player, itemMap, stage)));
} else {
soundPane.setReturnButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item commands menu."), event -> commandPane(player, itemMap)));
}
for (Sound sound : Sound.values()) {
if (stage != 3) {
soundPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "MUSIC_DISC_MELLOHI" : "2262"), 1, false, "&f" + sound.name(), "&7", "&7*Click to set the", "&7teleport-sound of the item."), event -> {
itemMap.setTeleportSound(sound.name());
soundVolumePane(player, itemMap, stage);
}));
} else {
soundPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "MUSIC_DISC_MELLOHI" : "2262"), 1, false, "&f" + sound.name(), "&7", "&7*Click to set the", "&7commands-sound of the item."), event -> {
itemMap.setCommandSound(sound);
soundVolumePane(player, itemMap, stage);
}));
}
}
});
soundPane.open(player);
}
use of me.RockinChaos.itemjoin.utils.interfaces.Interface in project ItemJoin by RockinChaos.
the class Menu method mobsPane.
/**
* Opens the Pane for the Player.
* This Pane is for setting the mobs drop chances.
*
* @param player - The Player to have the Pane opened.
* @param itemMap - The ItemMap currently being modified.
*/
private static void mobsPane(final Player player, final ItemMap itemMap) {
Interface dropsPane = new Interface(true, 6, GUIName, player);
SchedulerUtils.runAsync(() -> {
dropsPane.setReturnButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the drop chances menu."), event -> dropsPane(player, itemMap)));
for (EntityType entity : EntityType.values()) {
if (itemMap.getMobsDrop().containsKey(entity) && entity.isAlive()) {
dropsPane.addButton(new Button(ItemHandler.getItem("EGG", 1, (itemMap.getMobsDrop().containsKey(entity)), "&f" + entity.name(), "&7", "&7*Click to add this as", "&7a banner pattern.", (itemMap.getMobsDrop().containsKey(entity) ? "&9&lChance: &a" + itemMap.getMobsDrop().get(entity) : "")), event -> {
if (itemMap.getMobsDrop().containsKey(entity)) {
Map<EntityType, Double> mobsDrop = itemMap.getMobsDrop();
mobsDrop.remove(entity);
itemMap.setMobsDrop(mobsDrop);
mobsPane(player, itemMap);
} else {
chancePane(player, itemMap, entity, null);
}
}));
}
}
for (EntityType entity : EntityType.values()) {
if (!itemMap.getMobsDrop().containsKey(entity) && entity.isAlive()) {
dropsPane.addButton(new Button(ItemHandler.getItem("EGG", 1, (itemMap.getMobsDrop().containsKey(entity)), "&f" + entity.name(), "&7", "&7*Click to add this as", "&7a banner pattern.", (itemMap.getMobsDrop().containsKey(entity) ? "&9&lChance: &a" + itemMap.getMobsDrop().get(entity) : "")), event -> {
if (itemMap.getMobsDrop().containsKey(entity)) {
Map<EntityType, Double> mobsDrop = itemMap.getMobsDrop();
mobsDrop.remove(entity);
itemMap.setMobsDrop(mobsDrop);
mobsPane(player, itemMap);
} else {
chancePane(player, itemMap, entity, null);
}
}));
}
}
});
dropsPane.open(player);
}
use of me.RockinChaos.itemjoin.utils.interfaces.Interface in project ItemJoin by RockinChaos.
the class Menu method modifyMaterialPane.
/**
* 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 modifyMaterialPane(final Player player, final ItemMap itemMap, final int position) {
Interface modifyMaterialPane = new Interface(false, 2, GUIName, player);
SchedulerUtils.runAsync(() -> {
modifyMaterialPane.addButton(new Button(fillerPaneGItem), 3);
modifyMaterialPane.addButton(new Button(ItemHandler.getItem("NAME_TAG", 1, false, "&a&l&nMaterial", "&7", "&7*Change the animated material type.", "&9&lMaterial: &a" + ItemHandler.cutDelay(itemMap.getDynamicMaterials().get(position))), event -> selectMaterialPane(player, itemMap, position, false)));
modifyMaterialPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "CLOCK" : "347"), 1, false, "&e&l&nDuration", "&7", "&7*Change the duration of the animation.", "&9&lAnimation Ticks: &a" + StringUtils.returnInteger(ItemHandler.getDelayFormat(itemMap.getDynamicMaterials().get(position)))), event -> durationMaterialPane(player, itemMap, position, false, ItemHandler.cutDelay(itemMap.getDynamicMaterials().get(position)))));
modifyMaterialPane.addButton(new Button(ItemHandler.getItem("REDSTONE", 1, false, "&c&l&nDelete", "&7", "&7*Delete this animated material."), event -> {
List<String> mats = itemMap.getDynamicMaterials();
mats.remove(position);
itemMap.setDynamicMaterials(mats);
animateMaterialPane(player, itemMap);
}));
modifyMaterialPane.addButton(new Button(fillerPaneGItem), 3);
modifyMaterialPane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the animated material menu."), event -> animateMaterialPane(player, itemMap)));
modifyMaterialPane.addButton(new Button(fillerPaneBItem), 7);
modifyMaterialPane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the animated material menu."), event -> animateMaterialPane(player, itemMap)));
});
modifyMaterialPane.open(player);
}
use of me.RockinChaos.itemjoin.utils.interfaces.Interface in project ItemJoin by RockinChaos.
the class Menu method startHopper.
/**
* Opens the SAVING PANE for the Player.
*
* @param player - The Player to have the Pane opened.
*/
private static void startHopper(Player player) {
Interface dragDrop = new Interface(false, 1, GUIName, player);
SchedulerUtils.runAsync(() -> {
dragDrop.allowClick(true);
dragDrop.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nMain Menu", "&7", "&7*Returns you to the main menu."), event -> startMenu(player)));
dragDrop.addButton(new Button(ItemHandler.getItem("CHEST", 1, false, "&a&lAutosave", "&7", "&7*Click me to save your whole", "&7inventory to the items.yml as-is,", "&7including current slot positions!", "&7", "&c&l[&nALL&c&l ITEMS]"), event -> {
PlayerInventory playerInv = event.getWhoClicked().getInventory();
if (playerInv != null) {
for (int i = 0; i <= 35; i++) {
if (playerInv.getItem(i) != null && playerInv.getItem(i).getType() != Material.AIR) {
convertStack(player, playerInv.getItem(i), Integer.toString(i));
}
}
if (playerInv.getHelmet() != null && playerInv.getHelmet().getType() != Material.AIR) {
convertStack(player, playerInv.getHelmet(), "HELMET");
}
if (playerInv.getChestplate() != null && playerInv.getChestplate().getType() != Material.AIR) {
convertStack(player, playerInv.getChestplate(), "CHESTPLATE");
}
if (playerInv.getLeggings() != null && playerInv.getLeggings().getType() != Material.AIR) {
convertStack(player, playerInv.getLeggings(), "LEGGINGS");
}
if (playerInv.getBoots() != null && playerInv.getBoots().getType() != Material.AIR) {
convertStack(player, playerInv.getBoots(), "BOOTS");
}
if (ServerUtils.hasSpecificUpdate("1_9") && PlayerHandler.getOffHandItem(player) != null && PlayerHandler.getOffHandItem(player).getType() != Material.AIR) {
convertStack(player, PlayerHandler.getOffHandItem(player), "OFFHAND");
}
ConfigHandler.getConfig().reloadConfigs(true);
startMenu(player);
}
}));
dragDrop.addButton(new Button(fillerPaneGItem), 2);
dragDrop.addButton(new Button(ItemHandler.getItem("HOPPER", 1, false, "&a&lDrop an Item", "&7", "&7*Click an item from your inventory", "&7to save and drop it in this", "&7friendly little hopper!", "&7", "&a&l[&nSINGLE&a&l ITEM]"), event -> {
if (event.getCursor().getType() != Material.AIR) {
ItemStack item = event.getCursor().clone();
event.getWhoClicked().setItemOnCursor(null);
event.getWhoClicked().getInventory().addItem(item);
convertStack(player, item, null);
dragDrop.allowClick(false);
}
}));
dragDrop.addButton(new Button(fillerPaneGItem), 2);
dragDrop.addButton(new Button(ItemHandler.getItem("CHEST", 1, false, "&a&lAutosave", "&7", "&7*Click me to save your whole", "&7inventory to the items.yml as-is,", "&7including current slot positions!", "&7", "&c&l[&nALL&c&l ITEMS]"), event -> {
PlayerInventory playerInv = event.getWhoClicked().getInventory();
if (playerInv != null) {
for (int i = 0; i <= 35; i++) {
if (playerInv.getItem(i) != null && playerInv.getItem(i).getType() != Material.AIR) {
convertStack(player, playerInv.getItem(i), Integer.toString(i));
}
}
if (playerInv.getHelmet() != null && playerInv.getHelmet().getType() != Material.AIR) {
convertStack(player, playerInv.getHelmet(), "HELMET");
}
if (playerInv.getChestplate() != null && playerInv.getChestplate().getType() != Material.AIR) {
convertStack(player, playerInv.getChestplate(), "CHESTPLATE");
}
if (playerInv.getLeggings() != null && playerInv.getLeggings().getType() != Material.AIR) {
convertStack(player, playerInv.getLeggings(), "LEGGINGS");
}
if (playerInv.getBoots() != null && playerInv.getBoots().getType() != Material.AIR) {
convertStack(player, playerInv.getBoots(), "BOOTS");
}
if (ServerUtils.hasSpecificUpdate("1_9") && PlayerHandler.getOffHandItem(player) != null && PlayerHandler.getOffHandItem(player).getType() != Material.AIR) {
convertStack(player, PlayerHandler.getOffHandItem(player), "OFFHAND");
}
ConfigHandler.getConfig().reloadConfigs(true);
startMenu(player);
}
}));
dragDrop.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nMain Menu", "&7", "&7*Returns you to the main menu."), event -> startMenu(player)));
});
dragDrop.open(player);
}
use of me.RockinChaos.itemjoin.utils.interfaces.Interface in project ItemJoin by RockinChaos.
the class Menu method modifyNamePane.
/**
* Opens the Pane for the Player.
* This Pane is for modifying aniamted names.
*
* @param player - The Player to have the Pane opened.
* @param itemMap - The ItemMap currently being modified.
*/
private static void modifyNamePane(final Player player, final ItemMap itemMap, final int position) {
Interface modifyNamePane = new Interface(false, 2, GUIName, player);
SchedulerUtils.runAsync(() -> {
modifyNamePane.addButton(new Button(fillerPaneGItem), 3);
modifyNamePane.addButton(new Button(ItemHandler.getItem("NAME_TAG", 1, false, "&a&l&nName", "&7", "&7*Change the animated name line.", "&9&lName: &a" + ItemHandler.cutDelay(itemMap.getDynamicNames().get(position))), event -> {
player.closeInventory();
String[] placeHolders = LanguageAPI.getLang(false).newString();
placeHolders[16] = "NAME";
placeHolders[15] = "&bUltimate Sword";
LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputType", player, placeHolders);
LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputExample", player, placeHolders);
}, event -> {
List<String> names = itemMap.getDynamicNames();
names.set(position, "<delay:" + StringUtils.returnInteger(ItemHandler.getDelayFormat(names.get(position))) + ">" + ChatColor.stripColor(event.getMessage()));
itemMap.setDynamicNames(names);
String[] placeHolders = LanguageAPI.getLang(false).newString();
placeHolders[16] = "NAME";
LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputSet", player, placeHolders);
modifyNamePane(event.getPlayer(), itemMap, position);
}));
modifyNamePane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "CLOCK" : "347"), 1, false, "&e&l&nDuration", "&7", "&7*Change the duration of the animation.", "&9&lAnimation Ticks: &a" + StringUtils.returnInteger(ItemHandler.getDelayFormat(itemMap.getDynamicNames().get(position)))), event -> durationNamePane(player, itemMap, position, false, ItemHandler.cutDelay(itemMap.getDynamicNames().get(position)))));
modifyNamePane.addButton(new Button(ItemHandler.getItem("REDSTONE", 1, false, "&c&l&nDelete", "&7", "&7*Delete this animated name."), event -> {
List<String> names = itemMap.getDynamicNames();
names.remove(position);
itemMap.setDynamicNames(names);
animatedNamePane(player, itemMap);
}));
modifyNamePane.addButton(new Button(fillerPaneGItem), 3);
modifyNamePane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the animated name menu."), event -> animatedNamePane(player, itemMap)));
modifyNamePane.addButton(new Button(fillerPaneBItem), 7);
modifyNamePane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the animated name menu."), event -> animatedNamePane(player, itemMap)));
});
modifyNamePane.open(player);
}
Aggregations