Search in sources :

Example 26 with ItemMap

use of me.RockinChaos.itemjoin.item.ItemMap in project ItemJoin by RockinChaos.

the class Menu method sequencePane.

/**
 * Opens the Pane for the Player.
 * This Pane is for setting an items command sequence.
 *
 * @param player - The Player to have the Pane opened.
 * @param itemMap - The ItemMap currently being modified.
 */
private static void sequencePane(final Player player, final ItemMap itemMap, final int stage) {
    Interface sequencePane = new Interface(false, 2, GUIName, player);
    SchedulerUtils.runAsync(() -> {
        if (stage == 4) {
            sequencePane.addButton(new Button(fillerPaneGItem));
        }
        sequencePane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "CLOCK" : "347"), 1, false, "&a&lSequential", "&7", "&7*Executes the command lines", "&7in order from top to bottom."), event -> {
            if (stage == 4) {
                File fileFolder = new File(ItemJoin.getInstance().getDataFolder(), "config.yml");
                FileConfiguration dataFile = YamlConfiguration.loadConfiguration(fileFolder);
                dataFile.set("Active-Commands.commands-sequence", "SEQUENTIAL");
                ConfigHandler.getConfig().saveFile(dataFile, fileFolder, "config.yml");
                ConfigHandler.getConfig().softReload();
                SchedulerUtils.runLater(2L, () -> activeCommands(player));
            } else {
                itemMap.setCommandSequence(CommandSequence.SEQUENTIAL);
                commandPane(player, itemMap);
            }
        }));
        sequencePane.addButton(new Button(fillerPaneGItem));
        sequencePane.addButton(new Button(ItemHandler.getItem("DIAMOND", 1, false, "&a&lRandom Single", "&7", "&7*Executes one of the command lines", "&7randomly with equal values."), event -> {
            if (stage == 4) {
                File fileFolder = new File(ItemJoin.getInstance().getDataFolder(), "config.yml");
                FileConfiguration dataFile = YamlConfiguration.loadConfiguration(fileFolder);
                dataFile.set("Active-Commands.commands-sequence", "RANDOM_SINGLE");
                ConfigHandler.getConfig().saveFile(dataFile, fileFolder, "config.yml");
                ConfigHandler.getConfig().softReload();
                SchedulerUtils.runLater(2L, () -> activeCommands(player));
            } else {
                itemMap.setCommandSequence(CommandSequence.RANDOM_SINGLE);
                commandPane(player, itemMap);
            }
        }));
        sequencePane.addButton(new Button(fillerPaneGItem));
        sequencePane.addButton(new Button(ItemHandler.getItem("PAPER", 1, false, "&a&lRandom List", "&7", "&7*Randomly selects from a list", "&7of commands to execute."), event -> {
            if (stage == 4) {
                File fileFolder = new File(ItemJoin.getInstance().getDataFolder(), "config.yml");
                FileConfiguration dataFile = YamlConfiguration.loadConfiguration(fileFolder);
                dataFile.set("Active-Commands.commands-sequence", "RANDOM_LIST");
                ConfigHandler.getConfig().saveFile(dataFile, fileFolder, "config.yml");
                ConfigHandler.getConfig().softReload();
                SchedulerUtils.runLater(2L, () -> activeCommands(player));
            } else {
                itemMap.setCommandSequence(CommandSequence.RANDOM_LIST);
                commandPane(player, itemMap);
            }
        }));
        sequencePane.addButton(new Button(fillerPaneGItem));
        sequencePane.addButton(new Button(ItemHandler.getItem("EMERALD", 1, false, "&a&lRandom", "&7", "&7*Executes each command line in a", "&7random order with equal values."), event -> {
            if (stage == 4) {
                File fileFolder = new File(ItemJoin.getInstance().getDataFolder(), "config.yml");
                FileConfiguration dataFile = YamlConfiguration.loadConfiguration(fileFolder);
                dataFile.set("Active-Commands.commands-sequence", "RANDOM");
                ConfigHandler.getConfig().saveFile(dataFile, fileFolder, "config.yml");
                ConfigHandler.getConfig().softReload();
                SchedulerUtils.runLater(2L, () -> activeCommands(player));
            } else {
                itemMap.setCommandSequence(CommandSequence.RANDOM);
                commandPane(player, itemMap);
            }
        }));
        sequencePane.addButton(new Button(fillerPaneGItem));
        if (stage != 4) {
            sequencePane.addButton(new Button(ItemHandler.getItem("CHEST", 1, false, "&a&lRemain", "&7", "&7*Executes each command only if", "&7the item exists in the player", "&7inventory at the time of executing", "&7a delayed command line.", "&7The commands will be sent in", "&7order from top to bottom."), event -> {
                itemMap.setCommandSequence(CommandSequence.REMAIN);
                commandPane(player, itemMap);
            }));
        }
        if (stage == 4) {
            sequencePane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the active commands menu."), event -> activeCommands(player)));
        } else {
            sequencePane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item commands menu."), event -> commandPane(player, itemMap)));
        }
        sequencePane.addButton(new Button(fillerPaneBItem), 7);
        if (stage == 4) {
            sequencePane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the active commands menu."), event -> activeCommands(player)));
        } else {
            sequencePane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item commands menu."), event -> commandPane(player, itemMap)));
        }
    });
    sequencePane.open(player);
}
Also used : ItemHandler(me.RockinChaos.itemjoin.handlers.ItemHandler) PatternType(org.bukkit.block.banner.PatternType) Enchantment(org.bukkit.enchantments.Enchantment) GameProfile(com.mojang.authlib.GameProfile) Player(org.bukkit.entity.Player) LanguageAPI(me.RockinChaos.itemjoin.utils.api.LanguageAPI) Inventory(org.bukkit.inventory.Inventory) DependAPI(me.RockinChaos.itemjoin.utils.api.DependAPI) World(org.bukkit.World) Map(java.util.Map) PlayerInventory(org.bukkit.inventory.PlayerInventory) Material(org.bukkit.Material) FireworkEffectMeta(org.bukkit.inventory.meta.FireworkEffectMeta) Bukkit(org.bukkit.Bukkit) Action(me.RockinChaos.itemjoin.item.ItemCommand.Action) CommandSender(org.bukkit.command.CommandSender) UUID(java.util.UUID) Sound(org.bukkit.Sound) ItemMap(me.RockinChaos.itemjoin.item.ItemMap) EntityType(org.bukkit.entity.EntityType) FireworkMeta(org.bukkit.inventory.meta.FireworkMeta) ItemUtilities(me.RockinChaos.itemjoin.item.ItemUtilities) ItemStack(org.bukkit.inventory.ItemStack) List(java.util.List) SchedulerUtils(me.RockinChaos.itemjoin.utils.SchedulerUtils) StringUtils(me.RockinChaos.itemjoin.utils.StringUtils) LeatherArmorMeta(org.bukkit.inventory.meta.LeatherArmorMeta) ItemJoin(me.RockinChaos.itemjoin.ItemJoin) PotionEffectType(org.bukkit.potion.PotionEffectType) Button(me.RockinChaos.itemjoin.utils.interfaces.Button) ItemMeta(org.bukkit.inventory.meta.ItemMeta) Pattern(org.bukkit.block.banner.Pattern) BookMeta(org.bukkit.inventory.meta.BookMeta) Interface(me.RockinChaos.itemjoin.utils.interfaces.Interface) HashMap(java.util.HashMap) HeadDatabaseAPI(me.arcaniax.hdb.api.HeadDatabaseAPI) BannerMeta(org.bukkit.inventory.meta.BannerMeta) ServerUtils(me.RockinChaos.itemjoin.utils.ServerUtils) ArrayList(java.util.ArrayList) FileConfiguration(org.bukkit.configuration.file.FileConfiguration) Environment(org.bukkit.World.Environment) Property(com.mojang.authlib.properties.Property) ConfigHandler(me.RockinChaos.itemjoin.handlers.ConfigHandler) Color(org.bukkit.Color) Attribute(org.bukkit.attribute.Attribute) Type(org.bukkit.FireworkEffect.Type) PlayerHandler(me.RockinChaos.itemjoin.handlers.PlayerHandler) LegacyAPI(me.RockinChaos.itemjoin.utils.api.LegacyAPI) DecimalFormat(java.text.DecimalFormat) Field(java.lang.reflect.Field) File(java.io.File) PotionEffect(org.bukkit.potion.PotionEffect) CommandSequence(me.RockinChaos.itemjoin.item.ItemCommand.CommandSequence) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) ItemCommand(me.RockinChaos.itemjoin.item.ItemCommand) ChatColor(org.bukkit.ChatColor) DyeColor(org.bukkit.DyeColor) FileConfiguration(org.bukkit.configuration.file.FileConfiguration) Button(me.RockinChaos.itemjoin.utils.interfaces.Button) File(java.io.File) Interface(me.RockinChaos.itemjoin.utils.interfaces.Interface)

Example 27 with ItemMap

use of me.RockinChaos.itemjoin.item.ItemMap in project ItemJoin by RockinChaos.

the class Menu method commandPane.

// ============================================== //
// ItemCommand Menus        	       //
// ============================================== //
/**
 * Opens the Pane for the Player.
 * This Pane is for modifying an items commands.
 *
 * @param player - The Player to have the Pane opened.
 * @param itemMap - The ItemMap currently being modified.
 */
private static void commandPane(final Player player, final ItemMap itemMap) {
    Interface commandPane = new Interface(false, 3, GUIName, player);
    SchedulerUtils.runAsync(() -> {
        commandPane.addButton(new Button(fillerPaneGItem), 4);
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "WRITABLE_BOOK" : "386"), 1, false, "&e&lCommands", "&7", "&7*Click to define the custom command lines", "&7for the item and click type.", "&7", "&9&lCommands: &a" + (itemMap.getCommands().length != 0 ? "YES" : "NONE")), event -> actionPane(player, itemMap)));
        commandPane.addButton(new Button(fillerPaneGItem), 4);
        commandPane.addButton(new Button(ItemHandler.getItem("REDSTONE", 1, false, "&a&lParticle", "&7", "&7*Custom particle(s) that will be", "&7displayed when the commands", "&7are successfully executed.", "&9&lCOMMANDS-PARTICLE: &a" + StringUtils.nullCheck(itemMap.getCommandParticle() + "")), event -> {
            if (StringUtils.nullCheck(itemMap.getCommandParticle() + "") != "NONE") {
                itemMap.setCommandParticle(null);
                commandPane(player, itemMap);
            } else {
                particlePane(player, itemMap, 3);
            }
        }));
        commandPane.addButton(new Button(ItemHandler.getItem("EMERALD", 1, false, "&a&lItem Cost", "&7", "&7*Material that will", "&7be charged upon successfully", "&7executing the commands.", "&9&lCOMMANDS-ITEM: &a" + (StringUtils.nullCheck(itemMap.getItemCost()))), event -> {
            if (StringUtils.nullCheck(itemMap.getItemCost()) != "NONE") {
                itemMap.setItemCost(null);
                commandPane(player, itemMap);
            } else {
                materialPane(player, itemMap, 2, 0);
            }
        }));
        commandPane.addButton(new Button(ItemHandler.getItem("DIAMOND", 1, false, "&a&lCost", "&7", "&7*Amount that the player will", "&7be charged upon successfully", "&7executing the commands.", "&9&lCOMMANDS-COST: &a" + (StringUtils.nullCheck(itemMap.getCommandCost() + "&7"))), event -> {
            if (StringUtils.nullCheck(itemMap.getCommandCost() + "&7") != "NONE") {
                itemMap.setCommandCost(0);
                commandPane(player, itemMap);
            } else {
                costPane(player, itemMap);
            }
        }));
        commandPane.addButton(new Button(ItemHandler.getItem("STONE_BUTTON", 1, false, "&a&lReceive", "&7", "&7*The number of times the", "&7commands will execute when", "&7receiving the custom item.", "&cNOTE: &7Only functions with", "&7the on-receive command action.", "&9&lCOMMANDS-RECEIVE: &a" + (StringUtils.nullCheck(itemMap.getCommandReceive() + "&7"))), event -> {
            if (StringUtils.nullCheck(itemMap.getCommandReceive() + "&7") != "NONE") {
                itemMap.setCommandReceive(0);
                commandPane(player, itemMap);
            } else {
                receivePane(player, itemMap);
            }
        }));
        commandPane.addButton(new Button(ItemHandler.getItem("ICE", 1, false, "&a&lCooldown", "&7", "&7*The time that the commands will", "&7be on cooldown for.", "&7", "&9&lCOMMANDS-COOLDOWN: &a" + StringUtils.nullCheck(itemMap.getCommandCooldown() + "&7") + (StringUtils.nullCheck(itemMap.getCommandCooldown() + "&7") != "NONE" ? "&a second(s)" : "")), event -> {
            if (StringUtils.nullCheck(itemMap.getCommandCooldown() + "&7") != "NONE") {
                itemMap.setCommandCooldown(0);
                commandPane(player, itemMap);
            } else {
                cooldownPane(player, itemMap);
            }
        }));
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "OAK_SIGN" : "323"), 1, false, "&a&lCooldown Message", "&7", "&7*Optional cooldown message", "&7to be displayed when", "&7the items commands are", "&7on cooldown.", "&9&lCOOLDOWN-MESSAGE: &a" + StringUtils.nullCheck(itemMap.getCooldownMessage())), event -> {
            if (StringUtils.nullCheck(itemMap.getCooldownMessage()) != "NONE") {
                itemMap.setCooldownMessage(null);
                commandPane(player, itemMap);
            } else {
                player.closeInventory();
                String[] placeHolders = LanguageAPI.getLang(false).newString();
                placeHolders[16] = "COOLDOWN MESSAGE";
                placeHolders[15] = "&cThis item is on cooldown for &a%timeleft% &cseconds..";
                LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputType", player, placeHolders);
                LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputExample", player, placeHolders);
            }
        }, event -> {
            itemMap.setCooldownMessage(ChatColor.stripColor(event.getMessage()));
            String[] placeHolders = LanguageAPI.getLang(false).newString();
            placeHolders[16] = "COOLDOWN MESSAGE";
            LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputSet", player, placeHolders);
            commandPane(event.getPlayer(), itemMap);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem("JUKEBOX", 1, false, "&a&lSound", "&7", "&7*The sound that will be", "&7played after a successful", "&7command execution.", "&9&lCOMMANDS-SOUND: &a" + StringUtils.nullCheck(itemMap.getCommandSound() + ""), "&9&lVOLUME: &a" + ((StringUtils.nullCheck(itemMap.getCommandSound() + "") != "NONE") ? itemMap.getCommandVolume() : "0"), "&9&lPITCH: &a" + ((StringUtils.nullCheck(itemMap.getCommandSound() + "") != "NONE") ? itemMap.getCommandPitch() : "0")), event -> {
            if (StringUtils.nullCheck(itemMap.getCommandSound() + "") != "NONE") {
                itemMap.setCommandSound(null);
                commandPane(player, itemMap);
            } else {
                soundPane(player, itemMap, 3);
            }
        }));
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "REPEATER" : "356"), 1, false, "&a&lSequence", "&7", "&7*The order that the command lines", "&7will be executed in.", "&9&lCOMMANDS-SEQUENCE: &a" + StringUtils.nullCheck(itemMap.getCommandSequence() + "")), event -> {
            if (StringUtils.nullCheck(itemMap.getCommandSequence() + "") != "NONE") {
                itemMap.setCommandSequence(null);
                commandPane(player, itemMap);
            } else {
                sequencePane(player, itemMap, 0);
            }
        }));
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "LAVA_BUCKET" : "327"), 1, false, "&a&lWarmup", "&7", "&7*The time it will take before", "&7the commands are executed.", "&7Player movement will cancel the", "&7pending commands execution.", "&7", "&9&lCOMMANDS-WARMUP: &a" + StringUtils.nullCheck(itemMap.getWarmDelay() + "&7") + (StringUtils.nullCheck(itemMap.getWarmDelay() + "&7") != "NONE" ? "&a second(s)" : "")), event -> {
            if (StringUtils.nullCheck(itemMap.getWarmDelay() + "&7") != "NONE") {
                itemMap.setWarmDelay(0);
                commandPane(player, itemMap);
            } else {
                warmPane(player, itemMap);
            }
        }));
        commandPane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item definition menu."), event -> creatingPane(player, itemMap)));
        commandPane.addButton(new Button(fillerPaneBItem), 7);
        commandPane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item definition menu."), event -> creatingPane(player, itemMap)));
    });
    commandPane.open(player);
}
Also used : ItemHandler(me.RockinChaos.itemjoin.handlers.ItemHandler) PatternType(org.bukkit.block.banner.PatternType) Enchantment(org.bukkit.enchantments.Enchantment) GameProfile(com.mojang.authlib.GameProfile) Player(org.bukkit.entity.Player) LanguageAPI(me.RockinChaos.itemjoin.utils.api.LanguageAPI) Inventory(org.bukkit.inventory.Inventory) DependAPI(me.RockinChaos.itemjoin.utils.api.DependAPI) World(org.bukkit.World) Map(java.util.Map) PlayerInventory(org.bukkit.inventory.PlayerInventory) Material(org.bukkit.Material) FireworkEffectMeta(org.bukkit.inventory.meta.FireworkEffectMeta) Bukkit(org.bukkit.Bukkit) Action(me.RockinChaos.itemjoin.item.ItemCommand.Action) CommandSender(org.bukkit.command.CommandSender) UUID(java.util.UUID) Sound(org.bukkit.Sound) ItemMap(me.RockinChaos.itemjoin.item.ItemMap) EntityType(org.bukkit.entity.EntityType) FireworkMeta(org.bukkit.inventory.meta.FireworkMeta) ItemUtilities(me.RockinChaos.itemjoin.item.ItemUtilities) ItemStack(org.bukkit.inventory.ItemStack) List(java.util.List) SchedulerUtils(me.RockinChaos.itemjoin.utils.SchedulerUtils) StringUtils(me.RockinChaos.itemjoin.utils.StringUtils) LeatherArmorMeta(org.bukkit.inventory.meta.LeatherArmorMeta) ItemJoin(me.RockinChaos.itemjoin.ItemJoin) PotionEffectType(org.bukkit.potion.PotionEffectType) Button(me.RockinChaos.itemjoin.utils.interfaces.Button) ItemMeta(org.bukkit.inventory.meta.ItemMeta) Pattern(org.bukkit.block.banner.Pattern) BookMeta(org.bukkit.inventory.meta.BookMeta) Interface(me.RockinChaos.itemjoin.utils.interfaces.Interface) HashMap(java.util.HashMap) HeadDatabaseAPI(me.arcaniax.hdb.api.HeadDatabaseAPI) BannerMeta(org.bukkit.inventory.meta.BannerMeta) ServerUtils(me.RockinChaos.itemjoin.utils.ServerUtils) ArrayList(java.util.ArrayList) FileConfiguration(org.bukkit.configuration.file.FileConfiguration) Environment(org.bukkit.World.Environment) Property(com.mojang.authlib.properties.Property) ConfigHandler(me.RockinChaos.itemjoin.handlers.ConfigHandler) Color(org.bukkit.Color) Attribute(org.bukkit.attribute.Attribute) Type(org.bukkit.FireworkEffect.Type) PlayerHandler(me.RockinChaos.itemjoin.handlers.PlayerHandler) LegacyAPI(me.RockinChaos.itemjoin.utils.api.LegacyAPI) DecimalFormat(java.text.DecimalFormat) Field(java.lang.reflect.Field) File(java.io.File) PotionEffect(org.bukkit.potion.PotionEffect) CommandSequence(me.RockinChaos.itemjoin.item.ItemCommand.CommandSequence) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) ItemCommand(me.RockinChaos.itemjoin.item.ItemCommand) ChatColor(org.bukkit.ChatColor) DyeColor(org.bukkit.DyeColor) Button(me.RockinChaos.itemjoin.utils.interfaces.Button) Interface(me.RockinChaos.itemjoin.utils.interfaces.Interface)

Example 28 with ItemMap

use of me.RockinChaos.itemjoin.item.ItemMap in project ItemJoin by RockinChaos.

the class Menu method powerPane.

/**
 * Opens the Pane for the Player.
 * This Pane is for selecting the Firework Power.
 *
 * @param player - The Player to have the Pane opened.
 * @param itemMap - The ItemMap currently being modified.
 */
private static void powerPane(final Player player, final ItemMap itemMap) {
    Interface powerPane = new Interface(true, 6, GUIName, player);
    SchedulerUtils.runAsync(() -> {
        powerPane.setReturnButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the special settings menu."), event -> otherPane(player, itemMap)));
        powerPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "YELLOW_STAINED_GLASS_PANE" : "STAINED_GLASS_PANE:4"), 1, false, "&e&lCustom Power", "&7", "&7*Click to set a custom power", "&7value for the firework."), event -> {
            player.closeInventory();
            String[] placeHolders = LanguageAPI.getLang(false).newString();
            placeHolders[16] = "FIREWORK POWER";
            placeHolders[15] = "96";
            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.setFireworkPower(Integer.parseInt(ChatColor.stripColor(event.getMessage())));
                String[] placeHolders = LanguageAPI.getLang(false).newString();
                placeHolders[16] = "FIREWORK POWER";
                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);
            }
            otherPane(player, itemMap);
        }));
        for (int i = 1; i <= 64; i++) {
            final int k = i;
            powerPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "BLUE_STAINED_GLASS_PANE" : "STAINED_GLASS_PANE:11"), k, false, "&9&lPower Level: &a&l" + k, "&7", "&7*Click to set the", "&7power level of the firework."), event -> {
                itemMap.setFireworkPower(k);
                otherPane(player, itemMap);
            }));
        }
    });
    powerPane.open(player);
}
Also used : ItemHandler(me.RockinChaos.itemjoin.handlers.ItemHandler) PatternType(org.bukkit.block.banner.PatternType) Enchantment(org.bukkit.enchantments.Enchantment) GameProfile(com.mojang.authlib.GameProfile) Player(org.bukkit.entity.Player) LanguageAPI(me.RockinChaos.itemjoin.utils.api.LanguageAPI) Inventory(org.bukkit.inventory.Inventory) DependAPI(me.RockinChaos.itemjoin.utils.api.DependAPI) World(org.bukkit.World) Map(java.util.Map) PlayerInventory(org.bukkit.inventory.PlayerInventory) Material(org.bukkit.Material) FireworkEffectMeta(org.bukkit.inventory.meta.FireworkEffectMeta) Bukkit(org.bukkit.Bukkit) Action(me.RockinChaos.itemjoin.item.ItemCommand.Action) CommandSender(org.bukkit.command.CommandSender) UUID(java.util.UUID) Sound(org.bukkit.Sound) ItemMap(me.RockinChaos.itemjoin.item.ItemMap) EntityType(org.bukkit.entity.EntityType) FireworkMeta(org.bukkit.inventory.meta.FireworkMeta) ItemUtilities(me.RockinChaos.itemjoin.item.ItemUtilities) ItemStack(org.bukkit.inventory.ItemStack) List(java.util.List) SchedulerUtils(me.RockinChaos.itemjoin.utils.SchedulerUtils) StringUtils(me.RockinChaos.itemjoin.utils.StringUtils) LeatherArmorMeta(org.bukkit.inventory.meta.LeatherArmorMeta) ItemJoin(me.RockinChaos.itemjoin.ItemJoin) PotionEffectType(org.bukkit.potion.PotionEffectType) Button(me.RockinChaos.itemjoin.utils.interfaces.Button) ItemMeta(org.bukkit.inventory.meta.ItemMeta) Pattern(org.bukkit.block.banner.Pattern) BookMeta(org.bukkit.inventory.meta.BookMeta) Interface(me.RockinChaos.itemjoin.utils.interfaces.Interface) HashMap(java.util.HashMap) HeadDatabaseAPI(me.arcaniax.hdb.api.HeadDatabaseAPI) BannerMeta(org.bukkit.inventory.meta.BannerMeta) ServerUtils(me.RockinChaos.itemjoin.utils.ServerUtils) ArrayList(java.util.ArrayList) FileConfiguration(org.bukkit.configuration.file.FileConfiguration) Environment(org.bukkit.World.Environment) Property(com.mojang.authlib.properties.Property) ConfigHandler(me.RockinChaos.itemjoin.handlers.ConfigHandler) Color(org.bukkit.Color) Attribute(org.bukkit.attribute.Attribute) Type(org.bukkit.FireworkEffect.Type) PlayerHandler(me.RockinChaos.itemjoin.handlers.PlayerHandler) LegacyAPI(me.RockinChaos.itemjoin.utils.api.LegacyAPI) DecimalFormat(java.text.DecimalFormat) Field(java.lang.reflect.Field) File(java.io.File) PotionEffect(org.bukkit.potion.PotionEffect) CommandSequence(me.RockinChaos.itemjoin.item.ItemCommand.CommandSequence) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) ItemCommand(me.RockinChaos.itemjoin.item.ItemCommand) ChatColor(org.bukkit.ChatColor) DyeColor(org.bukkit.DyeColor) Button(me.RockinChaos.itemjoin.utils.interfaces.Button) Interface(me.RockinChaos.itemjoin.utils.interfaces.Interface)

Example 29 with ItemMap

use of me.RockinChaos.itemjoin.item.ItemMap in project ItemJoin by RockinChaos.

the class Menu method commandActionPane.

/**
 * Opens the Pane for the Player.
 * This Pane is for setting the command action conditions.
 *
 * @param player - The Player to have the Pane opened.
 * @param itemMap - The ItemMap currently being modified.
 */
private static void commandActionPane(final Player player, final ItemMap itemMap) {
    Interface commandPane = new Interface(false, 5, GUIName, player);
    SchedulerUtils.runAsync(() -> {
        commandPane.addButton(new Button(fillerPaneGItem), 2);
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "OAK_DOOR" : (ServerUtils.hasSpecificUpdate("1_8") ? "324" : "64")), 1, false, "&e&lInteract", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.INTERACT_ALL.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.INTERACT_ALL);
        }));
        commandPane.addButton(new Button(fillerPaneGItem));
        commandPane.addButton(new Button(ItemHandler.getItem("CHEST", 1, false, "&e&lInventory", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.INVENTORY_ALL.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.INVENTORY_ALL);
        }));
        commandPane.addButton(new Button(fillerPaneGItem));
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "PISTON" : "PISTON_BASE"), 1, false, "&e&lPhysical", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.PHYSICAL.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.PHYSICAL);
        }));
        commandPane.addButton(new Button(fillerPaneGItem), 2);
        commandPane.addButton(new Button(ItemHandler.getItem("DIAMOND_HELMET", 1, false, "&e&lOn-Equip", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.ON_EQUIP.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.ON_EQUIP);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem("IRON_HELMET", 1, false, "&e&lUn-Equip", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.UN_EQUIP.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.UN_EQUIP);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem("TORCH", 1, false, "&e&lOn-Hold", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.ON_HOLD.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.ON_HOLD);
        }));
        commandPane.addButton(new Button(fillerPaneGItem));
        commandPane.addButton(new Button(ItemHandler.getItem("ARROW", 1, false, "&e&lOn-Fire", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.ON_FIRE.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.ON_FIRE);
        }));
        commandPane.addButton(new Button(fillerPaneGItem));
        commandPane.addButton(new Button(ItemHandler.getItem("POTION", 1, false, "&e&lOn-Consume", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.ON_CONSUME.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.ON_CONSUME);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem("EMERALD", 1, false, "&e&lOn-Receive", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.ON_RECEIVE.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.ON_RECEIVE);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "SKELETON_SKULL" : "397"), 1, false, "&e&lOn-Death", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.ON_DEATH.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.ON_DEATH);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "GLASS" : "20"), 1, false, "&e&lInteract-Air", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.INTERACT_AIR.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.INTERACT_AIR);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "LIGHT_BLUE_STAINED_GLASS" : "95:3"), 1, false, "&e&lInteract-Air-Left", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.INTERACT_LEFT_AIR.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.INTERACT_LEFT_AIR);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "PINK_STAINED_GLASS" : "95:6"), 1, false, "&e&lInteract-Air-Right", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.INTERACT_RIGHT_AIR.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.INTERACT_RIGHT_AIR);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "GRASS_BLOCK" : "2:4"), 1, false, "&e&lInteract-Block", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.INTERACT_BLOCK.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.INTERACT_BLOCK);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "STONE" : "1"), 1, false, "&e&lInteract-Block-Left", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.INTERACT_LEFT_BLOCK.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.INTERACT_LEFT_BLOCK);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "COBBLESTONE" : "4"), 1, false, "&e&lInteract-Block-Right", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.INTERACT_RIGHT_BLOCK.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.INTERACT_RIGHT_BLOCK);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "IRON_DOOR" : "330"), 1, false, "&e&lInteract-Left", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.INTERACT_LEFT_ALL.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.INTERACT_LEFT_ALL);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "OAK_DOOR" : (ServerUtils.hasSpecificUpdate("1_8") ? "324" : "64")), 1, false, "&e&lInteract-Right", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.INTERACT_RIGHT_ALL.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.INTERACT_RIGHT_ALL);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem("FEATHER", 1, false, "&e&lInventory-Swap-Cursor", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.INVENTORY_SWAP_CURSOR.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.INVENTORY_SWAP_CURSOR);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "SNOWBALL" : "SNOW_BALL"), 8, false, "&e&lInventory-Middle", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.INVENTORY_MIDDLE.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.INVENTORY_MIDDLE);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "ENCHANTED_GOLDEN_APPLE" : "322:1"), 1, false, "&e&lInventory-Creative", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.INVENTORY_CREATIVE.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.INVENTORY_CREATIVE);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem("ENDER_CHEST", 1, false, "&e&lInventory-Left", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.INVENTORY_LEFT.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.INVENTORY_LEFT);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem("CHEST", 1, false, "&e&lInventory-Right", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.INVENTORY_RIGHT.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.INVENTORY_RIGHT);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "STONE_SLAB" : "44"), 2, false, "&e&lInventory-Shift-Left", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.INVENTORY_SHIFT_LEFT.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.INVENTORY_SHIFT_LEFT);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "COBBLESTONE_SLAB" : "44:3"), 2, false, "&e&lInventory-Shift-Right", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.INVENTORY_SHIFT_RIGHT.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.INVENTORY_SHIFT_RIGHT);
        }));
        commandPane.addButton(new Button(fillerPaneGItem));
        commandPane.addButton(new Button(ItemHandler.getItem("LAVA_BUCKET", 1, false, "&e&lOn-Damage", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.ON_DAMAGE.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.ON_DAMAGE);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem("DIAMOND_SWORD", 1, false, "&e&lOn-Hit", "&7", "&7*Condition(s) that must be met", "&7in order to execute item commands.", "&7", "&9&lENABLED: &a" + (StringUtils.nullCheck(itemMap.getCommandConditions().get(Action.ON_HIT.config()) + "") != "NONE" ? "YES" : "NO")), event -> {
            commandCPane(player, itemMap, Action.ON_HIT);
        }));
        commandPane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item conditions menu."), event -> conditionsPane(player, itemMap)));
        commandPane.addButton(new Button(fillerPaneBItem), 7);
        commandPane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item conditions menu."), event -> conditionsPane(player, itemMap)));
    });
    commandPane.open(player);
}
Also used : ItemHandler(me.RockinChaos.itemjoin.handlers.ItemHandler) PatternType(org.bukkit.block.banner.PatternType) Enchantment(org.bukkit.enchantments.Enchantment) GameProfile(com.mojang.authlib.GameProfile) Player(org.bukkit.entity.Player) LanguageAPI(me.RockinChaos.itemjoin.utils.api.LanguageAPI) Inventory(org.bukkit.inventory.Inventory) DependAPI(me.RockinChaos.itemjoin.utils.api.DependAPI) World(org.bukkit.World) Map(java.util.Map) PlayerInventory(org.bukkit.inventory.PlayerInventory) Material(org.bukkit.Material) FireworkEffectMeta(org.bukkit.inventory.meta.FireworkEffectMeta) Bukkit(org.bukkit.Bukkit) Action(me.RockinChaos.itemjoin.item.ItemCommand.Action) CommandSender(org.bukkit.command.CommandSender) UUID(java.util.UUID) Sound(org.bukkit.Sound) ItemMap(me.RockinChaos.itemjoin.item.ItemMap) EntityType(org.bukkit.entity.EntityType) FireworkMeta(org.bukkit.inventory.meta.FireworkMeta) ItemUtilities(me.RockinChaos.itemjoin.item.ItemUtilities) ItemStack(org.bukkit.inventory.ItemStack) List(java.util.List) SchedulerUtils(me.RockinChaos.itemjoin.utils.SchedulerUtils) StringUtils(me.RockinChaos.itemjoin.utils.StringUtils) LeatherArmorMeta(org.bukkit.inventory.meta.LeatherArmorMeta) ItemJoin(me.RockinChaos.itemjoin.ItemJoin) PotionEffectType(org.bukkit.potion.PotionEffectType) Button(me.RockinChaos.itemjoin.utils.interfaces.Button) ItemMeta(org.bukkit.inventory.meta.ItemMeta) Pattern(org.bukkit.block.banner.Pattern) BookMeta(org.bukkit.inventory.meta.BookMeta) Interface(me.RockinChaos.itemjoin.utils.interfaces.Interface) HashMap(java.util.HashMap) HeadDatabaseAPI(me.arcaniax.hdb.api.HeadDatabaseAPI) BannerMeta(org.bukkit.inventory.meta.BannerMeta) ServerUtils(me.RockinChaos.itemjoin.utils.ServerUtils) ArrayList(java.util.ArrayList) FileConfiguration(org.bukkit.configuration.file.FileConfiguration) Environment(org.bukkit.World.Environment) Property(com.mojang.authlib.properties.Property) ConfigHandler(me.RockinChaos.itemjoin.handlers.ConfigHandler) Color(org.bukkit.Color) Attribute(org.bukkit.attribute.Attribute) Type(org.bukkit.FireworkEffect.Type) PlayerHandler(me.RockinChaos.itemjoin.handlers.PlayerHandler) LegacyAPI(me.RockinChaos.itemjoin.utils.api.LegacyAPI) DecimalFormat(java.text.DecimalFormat) Field(java.lang.reflect.Field) File(java.io.File) PotionEffect(org.bukkit.potion.PotionEffect) CommandSequence(me.RockinChaos.itemjoin.item.ItemCommand.CommandSequence) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) ItemCommand(me.RockinChaos.itemjoin.item.ItemCommand) ChatColor(org.bukkit.ChatColor) DyeColor(org.bukkit.DyeColor) Button(me.RockinChaos.itemjoin.utils.interfaces.Button) Interface(me.RockinChaos.itemjoin.utils.interfaces.Interface)

Example 30 with ItemMap

use of me.RockinChaos.itemjoin.item.ItemMap in project ItemJoin by RockinChaos.

the class Menu method actionPane.

/**
 * Opens the Pane for the Player.
 * This Pane is for setting an action to a command.
 *
 * @param player - The Player to have the Pane opened.
 * @param itemMap - The ItemMap currently being modified.
 */
private static void actionPane(final Player player, final ItemMap itemMap) {
    Interface clickPane = new Interface(false, 5, GUIName, player);
    SchedulerUtils.runAsync(() -> {
        clickPane.addButton(new Button(fillerPaneGItem), 2);
        clickPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "OAK_DOOR" : (ServerUtils.hasSpecificUpdate("1_8") ? "324" : "64")), 1, false, "&e&lInteract", "&7", "&7*Commands that will execute only", "&7when left and right clicking.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.INTERACT_ALL)), event -> {
            commandListPane(player, itemMap, Action.INTERACT_ALL);
        }));
        clickPane.addButton(new Button(fillerPaneGItem));
        clickPane.addButton(new Button(ItemHandler.getItem("CHEST", 1, false, "&e&lInventory", "&7", "&7*Commands that will execute only", "&7when cursor clicking the item", "&7with the players inventory open.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.INVENTORY_ALL)), event -> {
            commandListPane(player, itemMap, Action.INVENTORY_ALL);
        }));
        clickPane.addButton(new Button(fillerPaneGItem));
        clickPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "PISTON" : "PISTON_BASE"), 1, false, "&e&lPhysical", "&7", "&7*Commands that will execute", "&7when held in the player hand", "&7and they interact with a object", "&7such as a pressure plate.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.PHYSICAL)), event -> {
            commandListPane(player, itemMap, Action.PHYSICAL);
        }));
        clickPane.addButton(new Button(fillerPaneGItem), 2);
        clickPane.addButton(new Button(ItemHandler.getItem("DIAMOND_HELMET", 1, false, "&e&lOn-Equip", "&7", "&7*Commands that will execute only", "&7when the item is placed", "&7in an armor slot.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.ON_EQUIP)), event -> {
            commandListPane(player, itemMap, Action.ON_EQUIP);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem("IRON_HELMET", 1, false, "&e&lUn-Equip", "&7", "&7*Commands that will execute only", "&7when the item is removed", "&7from an armor slot.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.UN_EQUIP)), event -> {
            commandListPane(player, itemMap, Action.UN_EQUIP);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem("TORCH", 1, false, "&e&lOn-Hold", "&7", "&7*Commands that will execute only", "&7when holding the item.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.ON_HOLD)), event -> {
            commandListPane(player, itemMap, Action.ON_HOLD);
        }));
        clickPane.addButton(new Button(fillerPaneGItem));
        clickPane.addButton(new Button(ItemHandler.getItem("ARROW", 1, false, "&e&lOn-Fire", "&7", "&7*Commands that will execute only", "&7when an arrow or bow is fired.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.ON_FIRE)), event -> {
            commandListPane(player, itemMap, Action.ON_FIRE);
        }));
        clickPane.addButton(new Button(fillerPaneGItem));
        clickPane.addButton(new Button(ItemHandler.getItem("POTION", 1, false, "&e&lOn-Consume", "&7", "&7*Commands that will execute only", "&7when you consume an the item.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.ON_CONSUME)), event -> {
            commandListPane(player, itemMap, Action.ON_CONSUME);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem("EMERALD", 1, false, "&e&lOn-Receive", "&7", "&7*Commands that will execute only", "&7when you are given the item.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.ON_RECEIVE)), event -> {
            commandListPane(player, itemMap, Action.ON_RECEIVE);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "SKELETON_SKULL" : "397"), 1, false, "&e&lOn-Death", "&7", "&7*Commands that will execute only", "&7when die with the", "&7item in your inventory.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.ON_DEATH)), event -> {
            commandListPane(player, itemMap, Action.ON_DEATH);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "GLASS" : "20"), 1, false, "&e&lInteract-Air", "&7", "&7*Commands that will execute only", "&7when left and right", "&7clicking the air.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.INTERACT_AIR)), event -> {
            commandListPane(player, itemMap, Action.INTERACT_AIR);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "LIGHT_BLUE_STAINED_GLASS" : "95:3"), 1, false, "&e&lInteract-Air-Left", "&7", "&7*Commands that will execute only", "&7when left clicking the air.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.INTERACT_LEFT_AIR)), event -> {
            commandListPane(player, itemMap, Action.INTERACT_LEFT_AIR);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "PINK_STAINED_GLASS" : "95:6"), 1, false, "&e&lInteract-Air-Right", "&7", "&7*Commands that will execute only", "&7when right clicking the air.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.INTERACT_RIGHT_AIR)), event -> {
            commandListPane(player, itemMap, Action.INTERACT_RIGHT_AIR);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "GRASS_BLOCK" : "2"), 1, false, "&e&lInteract-Block", "&7", "&7*Commands that will execute only", "&7when left and right", "&7clicking a block.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.INTERACT_BLOCK)), event -> {
            commandListPane(player, itemMap, Action.INTERACT_BLOCK);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "STONE" : "1"), 1, false, "&e&lInteract-Block-Left", "&7", "&7*Commands that will execute only", "&7when left clicking a block.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.INTERACT_LEFT_BLOCK)), event -> {
            commandListPane(player, itemMap, Action.INTERACT_LEFT_BLOCK);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "COBBLESTONE" : "4"), 1, false, "&e&lInteract-Block-Right", "&7", "&7*Commands that will execute only", "&7when right clicking a block.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.INTERACT_RIGHT_BLOCK)), event -> {
            commandListPane(player, itemMap, Action.INTERACT_RIGHT_BLOCK);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "IRON_DOOR" : "330"), 1, false, "&e&lInteract-Left", "&7", "&7*Commands that will execute only", "&7when left clicking.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.INTERACT_LEFT_ALL)), event -> {
            commandListPane(player, itemMap, Action.INTERACT_LEFT_ALL);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "OAK_DOOR" : (ServerUtils.hasSpecificUpdate("1_8") ? "324" : "64")), 1, false, "&e&lInteract-Right", "&7", "&7*Commands that will execute only", "&7when right clicking.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.INTERACT_RIGHT_ALL)), event -> {
            commandListPane(player, itemMap, Action.INTERACT_RIGHT_ALL);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem("FEATHER", 1, false, "&e&lInventory-Swap-Cursor", "&7", "&7*Commands that will execute only", "&7when cursor swapping with another item.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.INVENTORY_SWAP_CURSOR)), event -> {
            commandListPane(player, itemMap, Action.INVENTORY_SWAP_CURSOR);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "SNOWBALL" : "SNOW_BALL"), 8, false, "&e&lInventory-Middle", "&7", "&7*Commands that will execute only", "&7when cursor middle clicking the item.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.INVENTORY_MIDDLE)), event -> {
            commandListPane(player, itemMap, Action.INVENTORY_MIDDLE);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "ENCHANTED_GOLDEN_APPLE" : "322:1"), 1, false, "&e&lInventory-Creative", "&7", "&7*Commands that will execute only", "&7when cursor clicking the item in creative mode.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.INVENTORY_CREATIVE)), event -> {
            commandListPane(player, itemMap, Action.INVENTORY_CREATIVE);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem("ENDER_CHEST", 1, false, "&e&lInventory-Left", "&7", "&7*Commands that will execute only", "&7when cursor left clicking the item.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.INVENTORY_LEFT)), event -> {
            commandListPane(player, itemMap, Action.INVENTORY_LEFT);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem("CHEST", 1, false, "&e&lInventory-Right", "&7", "&7*Commands that will execute only", "&7when cursor right clicking the item.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.INVENTORY_RIGHT)), event -> {
            commandListPane(player, itemMap, Action.INVENTORY_RIGHT);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "STONE_SLAB" : "44"), 2, false, "&e&lInventory-Shift-Left", "&7", "&7*Commands that will execute only", "&7when cursor shift left clicking the item.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.INVENTORY_SHIFT_LEFT)), event -> {
            commandListPane(player, itemMap, Action.INVENTORY_SHIFT_LEFT);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "COBBLESTONE_SLAB" : "44:3"), 2, false, "&e&lInventory-Shift-Right", "&7", "&7*Commands that will execute only", "&7when cursor shift right clicking the item.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.INVENTORY_SHIFT_RIGHT)), event -> {
            commandListPane(player, itemMap, Action.INVENTORY_SHIFT_RIGHT);
        }));
        clickPane.addButton(new Button(fillerPaneGItem));
        clickPane.addButton(new Button(ItemHandler.getItem("LAVA_BUCKET", 1, false, "&e&lOn-Damage", "&7", "&7*Commands that will execute only", "&7when the player damages an", "&7entity or is damaged by an", "&7entity with the item in", "&7their inventory.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.ON_DAMAGE)), event -> {
            commandListPane(player, itemMap, Action.ON_DAMAGE);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem("DIAMOND_SWORD", 1, false, "&e&lOn-Hit", "&7", "&7*Commands that will execute only", "&7when the player damages an", "&7entity while holding the item.", "&7", "&9&lCommands: &a" + listCommands(itemMap, Action.ON_HIT)), event -> {
            commandListPane(player, itemMap, Action.ON_HIT);
        }));
        clickPane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item commands menu."), event -> commandPane(player, itemMap)));
        clickPane.addButton(new Button(fillerPaneBItem), 7);
        clickPane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item commands menu."), event -> commandPane(player, itemMap)));
    });
    clickPane.open(player);
}
Also used : ItemHandler(me.RockinChaos.itemjoin.handlers.ItemHandler) PatternType(org.bukkit.block.banner.PatternType) Enchantment(org.bukkit.enchantments.Enchantment) GameProfile(com.mojang.authlib.GameProfile) Player(org.bukkit.entity.Player) LanguageAPI(me.RockinChaos.itemjoin.utils.api.LanguageAPI) Inventory(org.bukkit.inventory.Inventory) DependAPI(me.RockinChaos.itemjoin.utils.api.DependAPI) World(org.bukkit.World) Map(java.util.Map) PlayerInventory(org.bukkit.inventory.PlayerInventory) Material(org.bukkit.Material) FireworkEffectMeta(org.bukkit.inventory.meta.FireworkEffectMeta) Bukkit(org.bukkit.Bukkit) Action(me.RockinChaos.itemjoin.item.ItemCommand.Action) CommandSender(org.bukkit.command.CommandSender) UUID(java.util.UUID) Sound(org.bukkit.Sound) ItemMap(me.RockinChaos.itemjoin.item.ItemMap) EntityType(org.bukkit.entity.EntityType) FireworkMeta(org.bukkit.inventory.meta.FireworkMeta) ItemUtilities(me.RockinChaos.itemjoin.item.ItemUtilities) ItemStack(org.bukkit.inventory.ItemStack) List(java.util.List) SchedulerUtils(me.RockinChaos.itemjoin.utils.SchedulerUtils) StringUtils(me.RockinChaos.itemjoin.utils.StringUtils) LeatherArmorMeta(org.bukkit.inventory.meta.LeatherArmorMeta) ItemJoin(me.RockinChaos.itemjoin.ItemJoin) PotionEffectType(org.bukkit.potion.PotionEffectType) Button(me.RockinChaos.itemjoin.utils.interfaces.Button) ItemMeta(org.bukkit.inventory.meta.ItemMeta) Pattern(org.bukkit.block.banner.Pattern) BookMeta(org.bukkit.inventory.meta.BookMeta) Interface(me.RockinChaos.itemjoin.utils.interfaces.Interface) HashMap(java.util.HashMap) HeadDatabaseAPI(me.arcaniax.hdb.api.HeadDatabaseAPI) BannerMeta(org.bukkit.inventory.meta.BannerMeta) ServerUtils(me.RockinChaos.itemjoin.utils.ServerUtils) ArrayList(java.util.ArrayList) FileConfiguration(org.bukkit.configuration.file.FileConfiguration) Environment(org.bukkit.World.Environment) Property(com.mojang.authlib.properties.Property) ConfigHandler(me.RockinChaos.itemjoin.handlers.ConfigHandler) Color(org.bukkit.Color) Attribute(org.bukkit.attribute.Attribute) Type(org.bukkit.FireworkEffect.Type) PlayerHandler(me.RockinChaos.itemjoin.handlers.PlayerHandler) LegacyAPI(me.RockinChaos.itemjoin.utils.api.LegacyAPI) DecimalFormat(java.text.DecimalFormat) Field(java.lang.reflect.Field) File(java.io.File) PotionEffect(org.bukkit.potion.PotionEffect) CommandSequence(me.RockinChaos.itemjoin.item.ItemCommand.CommandSequence) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) ItemCommand(me.RockinChaos.itemjoin.item.ItemCommand) ChatColor(org.bukkit.ChatColor) DyeColor(org.bukkit.DyeColor) Button(me.RockinChaos.itemjoin.utils.interfaces.Button) Interface(me.RockinChaos.itemjoin.utils.interfaces.Interface)

Aggregations

ItemMap (me.RockinChaos.itemjoin.item.ItemMap)140 Player (org.bukkit.entity.Player)124 ItemStack (org.bukkit.inventory.ItemStack)116 ArrayList (java.util.ArrayList)102 World (org.bukkit.World)96 PotionEffect (org.bukkit.potion.PotionEffect)95 HashMap (java.util.HashMap)94 List (java.util.List)94 ItemCommand (me.RockinChaos.itemjoin.item.ItemCommand)92 ChatColor (org.bukkit.ChatColor)92 Color (org.bukkit.Color)92 DyeColor (org.bukkit.DyeColor)92 Material (org.bukkit.Material)92 GameProfile (com.mojang.authlib.GameProfile)91 Property (com.mojang.authlib.properties.Property)91 File (java.io.File)91 Field (java.lang.reflect.Field)91 DecimalFormat (java.text.DecimalFormat)91 Map (java.util.Map)91 UUID (java.util.UUID)91