Search in sources :

Example 21 with ItemMap

use of me.RockinChaos.itemjoin.item.ItemMap 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);
}
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) List(java.util.List) ArrayList(java.util.ArrayList) Interface(me.RockinChaos.itemjoin.utils.interfaces.Interface)

Example 22 with ItemMap

use of me.RockinChaos.itemjoin.item.ItemMap 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);
}
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) List(java.util.List) ArrayList(java.util.ArrayList) Interface(me.RockinChaos.itemjoin.utils.interfaces.Interface)

Example 23 with ItemMap

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

the class Menu method dropsPane.

/**
 * Opens the Pane for the Player.
 * This Pane is for setting the drop chances.
 *
 * @param player - The Player to have the Pane opened.
 * @param itemMap - The ItemMap currently being modified.
 */
private static void dropsPane(final Player player, final ItemMap itemMap) {
    Interface dropsPane = new Interface(false, 3, GUIName, player);
    SchedulerUtils.runAsync(() -> {
        String mobs = "";
        String blocks = "";
        for (EntityType entity : itemMap.getMobsDrop().keySet()) {
            mobs += entity.name() + ", ";
        }
        for (Material material : itemMap.getBlocksDrop().keySet()) {
            blocks += material.name() + ", ";
        }
        dropsPane.addButton(new Button(fillerPaneBItem), 12);
        dropsPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "ZOMBIE_SPAWN_EGG" : "383:54"), 1, false, "&b&lMobs Drop", "&7", "&7*Define mobs that are", "&7allowed to drop the item.", (!mobs.isEmpty() ? "&9&lMobs: &a" + mobs.substring(0, mobs.length() - 2) : "")), event -> {
            mobsPane(player, itemMap);
        }));
        dropsPane.addButton(new Button(fillerPaneBItem));
        dropsPane.addButton(new Button(ItemHandler.getItem("DIAMOND_ORE", 1, false, "&b&lBlocks Drop", "&7", "&7*Define blocks that are", "&7allowed to drop the item.", (!blocks.isEmpty() ? "&9&lBlocks: &a" + blocks.substring(0, blocks.length() - 2) : "")), event -> {
            blocksPane(player, itemMap);
        }));
        dropsPane.addButton(new Button(fillerPaneBItem), 3);
        dropsPane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item definition menu."), event -> creatingPane(player, itemMap)));
        dropsPane.addButton(new Button(fillerPaneBItem), 7);
        dropsPane.addButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item definition menu."), event -> creatingPane(player, itemMap)));
    });
    dropsPane.open(player);
}
Also used : EntityType(org.bukkit.entity.EntityType) 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) Material(org.bukkit.Material) Interface(me.RockinChaos.itemjoin.utils.interfaces.Interface)

Example 24 with ItemMap

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

the class Menu method disposableCPane.

/**
 * Opens the Pane for the Player.
 * This Pane is for setting the disposable conditions.
 *
 * @param player - The Player to have the Pane opened.
 * @param itemMap - The ItemMap currently being modified.
 */
private static void disposableCPane(final Player player, final ItemMap itemMap) {
    Interface conditionsPane = new Interface(true, 2, GUIName, player);
    conditionsPane.setReturnButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item conditions menu."), event -> conditionsPane(player, itemMap)));
    SchedulerUtils.runAsync(() -> {
        conditionsPane.addButton(new Button(ItemHandler.getItem("NAME_TAG", 1, (StringUtils.nullCheck(itemMap.getDisposableMessage()) != "NONE"), "&c&lDisposable Fail Message", "&7", "&7*An optional message to be", "&7sent when the player does not", "&7meet the disposable conditions.", "&7", "&9&lMESSAGE: &a" + (StringUtils.nullCheck(itemMap.getDisposableMessage()) != "NONE" ? itemMap.getDisposableMessage() : "NONE")), event -> {
            if (StringUtils.nullCheck(itemMap.getDisposableMessage()) != "NONE") {
                itemMap.setDisposableMessage(null);
                disposableCPane(player, itemMap);
            } else {
                player.closeInventory();
                String[] placeHolders = LanguageAPI.getLang(false).newString();
                placeHolders[16] = "DISPOSABLE FAIL MESSAGE";
                placeHolders[15] = "&cYou do not meet the conditions to dispose of this item.";
                LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputType", player, placeHolders);
                LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputExample", player, placeHolders);
            }
        }, event -> {
            itemMap.setDisposableMessage(ChatColor.stripColor(event.getMessage()));
            String[] placeHolders = LanguageAPI.getLang(false).newString();
            placeHolders[16] = "DISPOSABLE FAIL MESSAGE";
            LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputSet", player, placeHolders);
            disposableCPane(event.getPlayer(), itemMap);
        }));
        conditionsPane.addButton(new Button(ItemHandler.getItem("FEATHER", 1, true, "&b&lAdd Condition", "&7", "&7*Condition(s) that must be met", "&7in order to dispose of the item."), event -> {
            player.closeInventory();
            String[] placeHolders = LanguageAPI.getLang(false).newString();
            placeHolders[16] = "FIRST VALUE";
            placeHolders[15] = "100";
            LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputType", player, placeHolders);
            LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputExample", player, placeHolders);
        }, event -> {
            String[] placeHolders = LanguageAPI.getLang(false).newString();
            placeHolders[16] = "FIRST VALUE";
            LanguageAPI.getLang(false).sendLangMessage("commands.menu.inputSet", player, placeHolders);
            addConditionPane(event.getPlayer(), itemMap, null, "disposable-conditions", ChatColor.stripColor(event.getMessage()));
        }));
        for (String condition : itemMap.getDisposableConditions()) {
            conditionsPane.addButton(new Button(ItemHandler.getItem("PAPER", 1, false, "&f" + condition, "&7", "&7*Click to remove this condition."), event -> {
                List<String> conditions = itemMap.getDisposableConditions();
                conditions.remove(condition);
                itemMap.setDisposableConditions(conditions);
                disposableCPane(player, itemMap);
            }));
        }
    });
    conditionsPane.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) List(java.util.List) ArrayList(java.util.ArrayList) Interface(me.RockinChaos.itemjoin.utils.interfaces.Interface)

Example 25 with ItemMap

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

the class Menu method flagPane.

/**
 * Opens the Pane for the Player.
 * This Pane is for modifying an items itemflags.
 *
 * @param player - The Player to have the Pane opened.
 * @param itemMap - The ItemMap currently being modified.
 */
private static void flagPane(final Player player, final ItemMap itemMap) {
    Interface flagPane = new Interface(true, 5, GUIName, player);
    flagPane.setReturnButton(new Button(ItemHandler.getItem("BARRIER", 1, false, "&c&l&nReturn", "&7", "&7*Returns you to the item definition menu."), event -> {
        setItemFlags(itemMap);
        creatingPane(player, itemMap);
    }));
    SchedulerUtils.runAsync(() -> {
        flagPane.addButton(new Button(ItemHandler.getItem("DIAMOND", 1, itemMap.isOpBypass(), "&a&l&nAllowOpBypass", "&7", "&a&lTrue&f:&7 Allows players who are OP to", "&7bypass any itemflags that add", "&7restrictions for this item.", "&7", "&c&lFalse&f:&7 Players who are OP will be", "&7restricted by itemflags that add", "&7restrictions for this item.", "&7", "&9&lENABLED: &a" + (itemMap.isOpBypass() + "").toUpperCase()), event -> {
            if (itemMap.isOpBypass()) {
                itemMap.setOpBypass(false);
            } else {
                itemMap.setOpBypass(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem(itemMap.isCreativeBypass() ? (ServerUtils.hasSpecificUpdate("1_13") ? "ENCHANTED_GOLDEN_APPLE" : "322:1") : "GOLDEN_APPLE", 1, itemMap.isCreativeBypass(), "&a&l&nCreativeBypass", "&7", "&a&lTrue&f:&7 Allows players who are in Creative", "&7to bypass any itemflags that add", "&7restrictions for this item.", "&7", "&c&lFalse&f:&7 Players who are in Creative will", "&7be restricted by itemflags that add", "&7restrictions for this item.", "&7", "&9&lENABLED: &a" + (itemMap.isCreativeBypass() + "").toUpperCase()), event -> {
            if (itemMap.isCreativeBypass()) {
                itemMap.setCreativeBypass(false);
            } else {
                itemMap.setCreativeBypass(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "LAPIS_LAZULI" : "351:4"), 1, itemMap.isGlowing(), "&a&l&nGlowing", "&7", "&a&lTrue&f:&7 The item will glow as if it was enchanted!", "&7", "&c&lFalse&f:&7 The item will not glow.", "&7", "&9&lENABLED: &a" + (itemMap.isGlowing() + "").toUpperCase()), event -> {
            if (itemMap.isGlowing()) {
                itemMap.setGlowing(false);
            } else {
                itemMap.setGlowing(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "DIAMOND_SHOVEL" : "277"), 7, itemMap.isStackable(), "&a&l&nStackable", "&7", "&a&lTrue&f:&7 The item will be stackable with itself!", "&7", "&c&lFalse&f:&7 The item stack only if it did in vanilla.", "&7", "&9&lENABLED: &a" + (itemMap.isStackable() + "").toUpperCase()), event -> {
            if (itemMap.isStackable()) {
                itemMap.setStackable(false);
            } else {
                itemMap.setStackable(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "POPPY" : "38"), 1, itemMap.isInventoryClose(), "&a&l&nInventory Close", "&7", "&a&lTrue&f:&7 Closes the players current", "&7inventory when clicking the item.", "&7", "&c&lFalse&f:&7 The current inventory will not", "&7be closed when clicking the item.", "&7", "&9&lENABLED: &a" + (itemMap.isInventoryClose() + "").toUpperCase()), event -> {
            if (itemMap.isInventoryClose()) {
                itemMap.setCloseInventory(false);
            } else {
                itemMap.setCloseInventory(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("REDSTONE", 1, itemMap.isAutoRemove(), "&a&l&nAuto Remove", "&7", "&a&lTrue&f:&7 Automatically removes the", "&7item from the players inventory", "&7when entering or joining a", "&7world that is not defined", "&7under the enabled-worlds.", "&7", "&c&lFalse&f:&7 The player will keep the", "&7item when entering or joining", "&7an undefined world.", "&7", "&9&lENABLED: &a" + (itemMap.isAutoRemove() + "").toUpperCase()), event -> {
            if (itemMap.isAutoRemove()) {
                itemMap.setAutoRemove(false);
            } else {
                itemMap.setAutoRemove(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "WRITABLE_BOOK" : "386"), 1, itemMap.isOverwritable(), "&a&l&nOverwrite", "&7", "&a&lTrue&f: &7Allows the item to overwrite", "&7any existing items in the defined slot.", "&7", "&c&lFalse&f:&7 The item will not overwrite other items.", "&7When the slot is full it", "&7will fail to give the item, unless", "&7the give-next or move-next flag is set to &a&lTrue&7.", "&7", "&9&lENABLED: &a" + (itemMap.isOverwritable() + "").toUpperCase()), event -> {
            if (itemMap.isOverwritable()) {
                itemMap.setOverwritable(false);
            } else {
                itemMap.setOverwritable(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("CACTUS", 1, itemMap.isDisposable(), "&a&l&nDisposable", "&7", "&a&lTrue&f:&7 If the item has a command", "&7defined, running the command", "&7will remove x1 of the item.", "&7", "&c&lFalse&f:&7 Running item commands will", "&7not lower the items count.", "&7", "&9&lENABLED: &a" + (itemMap.isDisposable() + "").toUpperCase()), event -> {
            if (itemMap.isDisposable()) {
                itemMap.setDisposable(false);
            } else {
                itemMap.setDisposable(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "WOODEN_SWORD" : "268"), 1, itemMap.isVanilla(), "&a&l&nVanilla", "&7", "&a&lTrue&f:&7 The item will be given as a default no-name item.", "&cNOTE: &7Itemflags and commands will NOT work", "&7unless the vanilla-status or vanilla-control", "&7itemflags are defined.", "&7", "&c&lFalse&f:&7 The item will be given", "&7as an custom item, allowing all", "&7ItemJoin properties to continue working.", "&7", "&9&lENABLED: &a" + (itemMap.isVanilla() + "").toUpperCase()), event -> {
            if (itemMap.isVanilla()) {
                itemMap.setVanilla(false);
            } else {
                itemMap.setVanilla(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("LEATHER_HELMET", 1, itemMap.isVanillaStatus(), "&a&l&nVanilla Status", "&7", "&a&lTrue&f: &7Allows the Vanilla itemflag to retain", "&7ItemJoin properties without", "&7making it only a ItemJoin specific item.", "&cNOTE: &7Useful for trying to implement", "&7ItemJoin items into other plugins.", "&7", "&c&lFalse&f:&7 The item will be given", "&7as a custom item, allowing all", "&7ItemJoin properties to continue working.", "&7", "&9&lENABLED: &a" + (itemMap.isVanillaStatus() + "").toUpperCase()), event -> {
            if (itemMap.isVanillaStatus()) {
                itemMap.setVanillaStatus(false);
            } else {
                itemMap.setVanillaStatus(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "WOODEN_PICKAXE" : "270"), 1, itemMap.isVanillaControl(), "&a&l&nVanilla Control", "&7", "&a&lTrue&f: &7Allows the Vanilla itemflag to retain", "&7the use of commands and itemflags.", "&7", "&c&lFalse&f:&7 The item will be given", "&7as an custom item, allowing all", "&7ItemJoin properties to continue working.", "&7", "&9&lENABLED: &a" + (itemMap.isVanillaControl() + "").toUpperCase()), event -> {
            if (itemMap.isVanillaControl()) {
                itemMap.setVanillaControl(false);
            } else {
                itemMap.setVanillaControl(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("PAPER", 1, itemMap.isIpLimted(), "&a&l&nIP Limit", "&7", "&a&lTrue&f:&7 The item will be tied to the players IP.", "&7No other players using the same IP will receive the item.", "&7Useful to prevent item duplication.", "&7", "&c&lFalse&f:&7 The item will not be tied to a players IP.", "&7Other player accounts using the same IP will receive the item.", "&7", "&9&lENABLED: &a" + (itemMap.isIpLimted() + "").toUpperCase()), event -> {
            if (itemMap.isIpLimted()) {
                itemMap.setIpLimited(false);
            } else {
                itemMap.setIpLimited(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem(itemMap.isUnbreakable() ? "ENCHANTED_BOOK" : "BOOK", 1, itemMap.isUnbreakable(), "&a&l&nUnbreakable", "&7", "&a&lTrue&f:&7 Allows the item to be unbreakable or INDESTRUCTIBLE!", "&7", "&c&lFalse&f:&7 The item will be damageable when being used.", "&7", "&7This flag only takes effect on items which have durability.", "&7", "&9&lENABLED: &a" + (itemMap.isUnbreakable() + "").toUpperCase()), event -> {
            if (itemMap.isUnbreakable()) {
                itemMap.setUnbreakable(false);
            } else {
                itemMap.setUnbreakable(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "FILLED_MAP" : "358"), 1, itemMap.isFlagsInfo(), "&a&l&nHide Flags", "&7", "&a&lTrue&f: &7Hides all information tags from the item", "&7such as firework colors, damage values, enchants, etc.", "&7", "&c&lFalse&f:&7 The item will have information tags visible.", "&7", "&9&lENABLED: &a" + (itemMap.isFlagsInfo() + "").toUpperCase()), event -> {
            if (itemMap.isFlagsInfo()) {
                itemMap.setFlagsInfo(false);
            } else {
                itemMap.setFlagsInfo(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "ENDER_EYE" : "381"), 1, itemMap.isAttributesInfo(), "&a&l&nHide Attributes", "&7", "&a&lTrue&f: &7Hides all attribute tags from the item", "&7such damage values, attack speed, hit points, etc.", "&7Typically this is the information that", "&7starts with (When in Main Hand:).", "&7", "&c&lFalse&f:&7 The item will have information tags visible.", "&7", "&9&lENABLED: &a" + (itemMap.isAttributesInfo() + "").toUpperCase()), event -> {
            if (itemMap.isAttributesInfo()) {
                itemMap.setAttributesInfo(false);
            } else {
                itemMap.setAttributesInfo(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("IRON_SWORD", 1, itemMap.isDurabilityBar(), "&a&l&nHide Durability", "&7", "&a&lTrue&f:&7 The durability bar of the damageable ", "&7item will be hidden.", "&cNOTE: &7Items with this flag will still break,", "&7unless the unbreakable flag is set to &a&lTrue&7.", "&7", "&c&lFalse&f:&7 The durability bar of the", "&7damageable item will be shown as normal.", "&7", "&9&lENABLED: &a" + (itemMap.isDurabilityBar() + "").toUpperCase()), event -> {
            if (itemMap.isDurabilityBar()) {
                itemMap.setDurabilityBar(false);
            } else {
                itemMap.setDurabilityBar(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("COBBLESTONE", 1, itemMap.isPlaceable(), "&a&l&nPlacement", "&7", "&a&lTrue&f: &7Prevents the item from being", "&7placed on the ground,", "&7in any item-frames, and entities.", "&7", "&c&lFalse&f: &7Item will be able to be placed.", "&7", "&9&lENABLED: &a" + (itemMap.isPlaceable() + "").toUpperCase()), event -> {
            if (itemMap.isPlaceable()) {
                itemMap.setPlaceable(false);
            } else {
                itemMap.setPlaceable(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("BEDROCK", 1, itemMap.isMovement(), "&a&l&nInventory Modify", "&7", "&a&lTrue&f: &7Prevents the item from being", "&7moved or switched to other slots", "&7and blocks placement in item-frames.", "&7", "&c&lFalse&f:&7 Allows the item to be moved", "&7freely inside the players inventory.", "&7", "&9&lENABLED: &a" + (itemMap.isMovement() + "").toUpperCase()), event -> {
            if (itemMap.isMovement()) {
                itemMap.setMovement(false);
            } else {
                itemMap.setMovement(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("DIAMOND_HELMET", 1, itemMap.isEquip(), "&a&l&nCancel Equip", "&7", "&a&lTrue&f: &7Prevents the item from being", "&7moved or switched to armor slots.", "&7", "&c&lFalse&f:&7 Allows the item to be moved", "&7freely inside the players inventory.", "&7", "&9&lENABLED: &a" + (itemMap.isEquip() + "").toUpperCase()), event -> {
            if (itemMap.isEquip()) {
                itemMap.setEquip(false);
            } else {
                itemMap.setEquip(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("NAME_TAG", 1, itemMap.isDynamic(), "&a&l&nDynamic", "&7", "&a&lTrue&f: &7Allows the item to dynamically", "&7update every 100 ticks", "&7Useful for updating placeholders.", "&7", "&c&lFalse&f: &7Item will not update its name, lore, etc.", "&7", "&9&lENABLED: &a" + (itemMap.isDynamic() + "").toUpperCase()), event -> {
            if (itemMap.isDynamic()) {
                itemMap.setDynamic(false);
            } else {
                itemMap.setDynamic(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("EGG", 1, itemMap.isAnimated(), "&a&l&nAnimate", "&7", "&a&lTrue&f: &7Allows the item to animate between", "&7its different iterations defined", "&7under the animations tab.", "&7", "&c&lFalse&f: &7Item will not animate.", "&7", "&9&lENABLED: &a" + (itemMap.isAnimated() + "").toUpperCase()), event -> {
            if (itemMap.isAnimated()) {
                itemMap.setAnimate(false);
            } else {
                itemMap.setAnimate(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "CHEST_MINECART" : "342"), 1, itemMap.isItemStore(), "&a&l&nItem Store", "&7", "&a&lTrue&f:&7 Prevents the storage of the item in any containers.", "&7Such as chests, armor stands, anvils, etc.", "&7", "&c&lFalse&f:&7 The item can be stored in containers.", "&7", "&9&lENABLED: &a" + (itemMap.isItemStore() + "").toUpperCase()), event -> {
            if (itemMap.isItemStore()) {
                itemMap.setItemStore(false);
            } else {
                itemMap.setItemStore(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "OAK_DOOR" : (ServerUtils.hasSpecificUpdate("1_8") ? "324" : "64")), 1, itemMap.isCountLock(), "&a&l&nCount Lock", "&7", "&a&lTrue&f:&7 The item can be used indefinitely.", "&7Useful to give a player infinite apples.", "&cNOTE: &7This will overwrite the disposable flag.", "&7", "&c&lFalse&f:&7 The item will be removed from the inventory on use.", "&7", "&9&lENABLED: &a" + (itemMap.isCountLock() + "").toUpperCase()), event -> {
            if (itemMap.isCountLock()) {
                itemMap.setCountLock(false);
            } else {
                itemMap.setCountLock(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("CHEST", 1, itemMap.isDeathKeepable(), "&a&l&nDeath Keep", "&7", "&a&lTrue&f:&7 On death, the item will remain", "&7in players inventory on respawn.", "&7", "&c&lFalse&f:&7 On death, the item will be dropped", "&7at the death location as normal.", "&7", "&9&lENABLED: &a" + (itemMap.isDeathKeepable() + "").toUpperCase()), event -> {
            if (itemMap.isDeathKeepable()) {
                itemMap.setDeathKeepable(false);
            } else {
                itemMap.setDeathKeepable(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("BONE", 1, itemMap.isDeathDroppable(), "&a&l&nDeath Drops", "&7", "&a&lTrue&f:&7 On death, the item will be removed", "&7from the players inventory.", "&7", "&c&lFalse&f:&7 On death, the item will be dropped", "&7at the death location as normal.", "&7", "&9&lENABLED: &a" + (itemMap.isDeathDroppable() + "").toUpperCase()), event -> {
            if (itemMap.isDeathDroppable()) {
                itemMap.setDeathDroppable(false);
            } else {
                itemMap.setDeathDroppable(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("HOPPER", 1, itemMap.isSelfDroppable(), "&a&l&nSelf Drops", "&7", "&a&lTrue&f: &7Prevents the item from being dropped", "&7by the player, returns it back to their inventory.", "&7", "&c&lFalse&f: &7Allows the item to be dropped.", "&7", "&9&lENABLED: &a" + (itemMap.isSelfDroppable() + "").toUpperCase()), event -> {
            if (itemMap.isSelfDroppable()) {
                itemMap.setSelfDroppable(false);
            } else {
                itemMap.setSelfDroppable(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("FURNACE", 1, itemMap.isItemModify(), "&a&l&nItem Modifiable", "&7", "&a&lTrue&f: &7Blocks the item from being", "&7repaired or enchanted in-game.", "&7", "&c&lFalse&f: &7Allows items to", "&7be repaired and enchanted.", "&7", "&9&lENABLED: &a" + (itemMap.isItemModify() + "").toUpperCase()), event -> {
            if (itemMap.isItemModify()) {
                itemMap.setItemModify(false);
            } else {
                itemMap.setItemModify(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("ANVIL", 1, itemMap.isItemRepairable(), "&a&l&nItem Repairable", "&7", "&a&lTrue&f: &7Blocks the item from being", "&7used in an anvil or repaired.", "&7", "&c&lFalse&f: &7Allows the item to be repaired.", "&7", "&9&lENABLED: &a" + (itemMap.isItemRepairable() + "").toUpperCase()), event -> {
            if (itemMap.isItemRepairable()) {
                itemMap.setItemRepairable(false);
            } else {
                itemMap.setItemRepairable(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "CRAFTING_TABLE" : "58"), 1, itemMap.isItemCraftable(), "&a&l&nItem Craftable", "&7", "&a&lTrue&f: &7Blocks the item from being", "&7used in a crafting recipe.", "&7", "&c&lFalse&f: &7Item will be usable in", "&7a crafting recipe.", "&7", "&9&lENABLED: &a" + (itemMap.isItemCraftable() + "").toUpperCase()), event -> {
            if (itemMap.isItemCraftable()) {
                itemMap.setItemCraftable(false);
            } else {
                itemMap.setItemCraftable(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("BOW", 1, itemMap.isCancelEvents(), "&a&l&nCancel Events", "&7", "&a&lTrue&f: &7Prevents almost any event from executing", "&7when right-clicking the item.", "&7", "&c&lFalse&f: &7Allows item events to be executed freely.", "&7", "&9&lENABLED: &a" + (itemMap.isCancelEvents() + "").toUpperCase()), event -> {
            if (itemMap.isCancelEvents()) {
                itemMap.setCancelEvents(false);
            } else {
                itemMap.setCancelEvents(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "WHEAT_SEEDS" : "295"), 1, itemMap.isAlwaysGive(), "&a&l&nAlways Give", "&7", "&a&lTrue&f: &7Gives the item every time the player", "&7performs one of the triggers actions.", "&7regardless of already having the item.", "&7", "&cNOTE: &7Don't use this if you want only ONE instance of the item.", "&7", "&c&lFalse&f: &7Normal item restrictions will apply.", "&7", "&9&lENABLED: &a" + (itemMap.isAlwaysGive() + "").toUpperCase()), event -> {
            if (itemMap.isAlwaysGive()) {
                itemMap.setAlwaysGive(false);
            } else {
                itemMap.setAlwaysGive(true);
            }
            flagPane(player, itemMap);
        }));
        if (itemMap.getMaterial().toString().contains("TIPPED_ARROW") || itemMap.getMaterial().toString().contains("ARROW")) {
            flagPane.addButton(new Button(ItemHandler.getItem("ENDER_PEARL", 1, itemMap.isTeleport(), "&a&l&nTeleport", "&7", "&a&lTrue&f: &7Teleports the Player to the location", "&7that the arrow landed.", "&cNOTE: &7This only works if the arrow is fired by a Bow.", "&9&lENABLED: &a" + (itemMap.isTeleport() + "").toUpperCase()), event -> {
                if (itemMap.isTeleport()) {
                    itemMap.setTeleport(false);
                } else {
                    itemMap.setTeleport(true);
                }
                flagPane(player, itemMap);
            }));
        } else {
            flagPane.addButton(new Button(fillerPaneBItem));
        }
        flagPane.addButton(new Button(ItemHandler.getItem((ServerUtils.hasSpecificUpdate("1_13") ? "ENCHANTING_TABLE" : "116"), 1, itemMap.isItemChangable(), "&a&l&nAllow Modifications", "&7", "&a&lTrue&f: &7Allows the players to modify the item", "&7while retaining all properties.", "&7", "&c&lFalse&f: &7Item will not be modifiable.", "&7", "&9&lENABLED: &a" + (itemMap.isItemChangable() + "").toUpperCase()), event -> {
            if (itemMap.isItemChangable()) {
                itemMap.setItemChangable(false);
            } else {
                itemMap.setItemChangable(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("ITEM_FRAME", 1, itemMap.isGiveNext(), "&a&l&nGive Next", "&7", "&a&lTrue&f: &7Gives the item to the next available slot", "&7only if the defined slot already has an existing item.", "&cNOTE: &7The overwrite flag will not work.", "&7", "&c&lFalse&f:&7 The item will be only given in the defined slot.", "&7If an item is already in the slot the", "&7item wont be given, unless the overwrite", "&7flag is set to &l&aTrue&7.", "&7", "&9&lENABLED: &a" + (itemMap.isGiveNext() + "").toUpperCase()), event -> {
            if (itemMap.isGiveNext()) {
                itemMap.setGiveNext(false);
            } else {
                itemMap.setGiveNext(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("MINECART", 1, itemMap.isMoveNext(), "&a&l&nMove Next", "&7", "&a&lTrue&f: &7Moves the existing item to the next available slot", "&7only if the defined slot already has an existing item.", "&cNOTE: &7The overwrite flag will not work.", "&7", "&c&lFalse&f: &7The item will be only given in the defined slot.", "&7If an item is already in the slot the", "&7item wont be given, unless the overwrite", "&7flag is set to &l&aTrue&7.", "&7", "&9&lENABLED: &a" + (itemMap.isMoveNext() + "").toUpperCase()), event -> {
            if (itemMap.isMoveNext()) {
                itemMap.setMoveNext(false);
            } else {
                itemMap.setMoveNext(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("DIAMOND_SWORD", 1, itemMap.isDropFull(), "&a&l&nDrop Full", "&7", "&a&lTrue&f: &7Drops the item on the ground if", "&7the players inventory is full.", "&7", "&c&lFalse&f: &7Fails to give the item", "&7if the players inventory is full.", "&7", "&9&lENABLED: &a" + (itemMap.isDropFull() + "").toUpperCase()), event -> {
            if (itemMap.isDropFull()) {
                itemMap.setDropFull(false);
            } else {
                itemMap.setDropFull(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(ItemHandler.getItem("SUGAR", 1, itemMap.isSelectable(), "&a&l&nSelectable", "&7", "&a&lTrue&f: &7Prevents the item from being", "&7held in the players hand.", "&7", "&c&lFalse&f: &7Allows the item to be selected.", "&7", "&9&lENABLED: &a" + (itemMap.isSelectable() + "").toUpperCase()), event -> {
            if (itemMap.isSelectable()) {
                itemMap.setSelectable(false);
            } else {
                itemMap.setSelectable(true);
            }
            flagPane(player, itemMap);
        }));
        flagPane.addButton(new Button(fillerPaneBItem), 35);
    });
    flagPane.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