From 29097b90c07bfd3e91faa750f360d4463ecc16fc Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Mon, 15 May 2023 19:49:09 +0200 Subject: [PATCH 01/13] Improves legacy item performance and refactors PlayerInteractListener I think the CachedSet was used wrong. I tried refactoring the class and properly check and add ItemStacks to it properly. If the user reports back with performance issues still persisting... Honestly I'll just remove support for legacy items in general. Server/Users had enought time to redeem them by now. CachedSet is using a WeakHashMap which might actually make the whole Set useless but I didn't do any testing on that today --- .../listeners/PlayerInteractListener.java | 105 +++++++++++------- 1 file changed, 67 insertions(+), 38 deletions(-) diff --git a/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java b/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java index 31c64b3..9219dac 100644 --- a/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java +++ b/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java @@ -12,10 +12,12 @@ import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; +import java.util.Collection; + public class PlayerInteractListener implements Listener { private final EpicVouchers instance; - private final CachedSet checkedLegacyVouchers = new CachedSet<>(3 * 60); + private final CachedSet itemsThatGotLegacyChecked = new CachedSet<>(3 * 60); public PlayerInteractListener(EpicVouchers instance) { this.instance = instance; @@ -24,53 +26,80 @@ public class PlayerInteractListener implements Listener { @EventHandler public void voucherListener(PlayerInteractEvent e) { ItemStack item = e.getItem(); + if (item == null || !isRightClickAction(e.getAction())) { + return; + } - if (item != null && (e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK)) { - NBTItem itemNbt = new NBTItem(item); + NBTItem nbtItem = new NBTItem(item); - boolean itemHasVoucher = itemNbt.hasKey("epicvouchers:voucher"); - String itemVoucherValue = itemNbt.getString("epicvouchers:voucher"); + boolean itemHasVoucher = nbtItem.hasTag("epicvouchers:voucher"); + boolean itemHasBeenLegacyChecked = this.itemsThatGotLegacyChecked.contains(item); + if (!itemHasVoucher && itemHasBeenLegacyChecked) { + return; + } - boolean legacyChecked = checkedLegacyVouchers.contains(item); + Voucher voucher; + Collection allVouchers = this.instance.getVoucherManager().getVouchers(); - if (itemHasVoucher || !legacyChecked) { - boolean shouldBeLegacyCached = !itemHasVoucher; + if (itemHasVoucher) { + String voucherKey = nbtItem.getString("epicvouchers:voucher"); + voucher = findVoucherForKey(voucherKey, allVouchers); + if (voucher != null) { + e.setCancelled(true); + voucher.redeemVoucher(e); + } - for (Voucher voucher : instance.getVoucherManager().getVouchers()) { - // Check voucher NBT. - if (itemHasVoucher && itemVoucherValue.equals(voucher.getKey())) { - e.setCancelled(true); - voucher.redeemVoucher(e); - break; - } + return; + } - // TODO: eventually make the legacy check configurable as a lot of players (and vouchers) quickly cause lag - // Legacy crap. - // does the item they're holding match this voucher? - ItemStack voucherItem = voucher.toItemStack(); + voucher = findVoucherForLegacyItem(item, allVouchers); + if (voucher == null) { + this.itemsThatGotLegacyChecked.add(item); + return; + } - if ((voucherItem == null || voucherItem.isSimilar(item)) && - item.getType() == voucher.getMaterial() && - item.getDurability() == voucher.getData()) { - // material matches - verify the name + lore - ItemMeta meta = item.getItemMeta(); + e.setCancelled(true); + voucher.redeemVoucher(e); + } - if (meta != null && meta.hasDisplayName() - && ChatColor.stripColor(meta.getDisplayName()).equals(ChatColor.stripColor(voucher.getName(true))) - && (!meta.hasLore() || meta.getLore().equals(voucher.getLore(true)))) { - e.setCancelled(true); - voucher.redeemVoucher(e); + private boolean isRightClickAction(Action action) { + return action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK; + } - shouldBeLegacyCached = false; - break; - } - } - } - - if (shouldBeLegacyCached) { - this.checkedLegacyVouchers.add(item); - } + private Voucher findVoucherForKey(String voucherKey, Collection allVouchers) { + for (Voucher voucher : allVouchers) { + if (voucherKey.equals(voucher.getKey())) { + return voucher; } } + + return null; + } + + /** + * @deprecated This is a legacy method that is only used for backwards compatibility + * with vouchers that were created before the voucher key was stored in NBT. + * Some checks in here don't even look like they make sense or look redundant... Hard to touch this. + */ + @Deprecated + private Voucher findVoucherForLegacyItem(ItemStack item, Collection allVouchers) { + for (Voucher voucher : allVouchers) { + ItemStack voucherItem = voucher.toItemStack(); + + if (voucherItem != null && !voucherItem.isSimilar(item)) { + continue; + } + if (item.getType() != voucher.getMaterial() || item.getDurability() != voucher.getData()) { + continue; + } + + // material matches - verify the name + lore + ItemMeta meta = item.getItemMeta(); + if (meta != null && meta.hasDisplayName() && ChatColor.stripColor(meta.getDisplayName()).equals(ChatColor.stripColor(voucher.getName(true))) && (!meta.hasLore() || meta.getLore().equals(voucher.getLore(true)))) { + return voucher; + } + } + + return null; } } From a0a235114837cd724ec2bc520aa1928b17c1ac8e Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Mon, 15 May 2023 19:49:25 +0200 Subject: [PATCH 02/13] Updates SongodaCore to v2.6.21 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 24f7190..4700244 100644 --- a/pom.xml +++ b/pom.xml @@ -114,7 +114,7 @@ com.songoda SongodaCore - 2.6.19 + 2.6.21 compile From 4aee977bfa0a706d7b613a65e09675215588b6f9 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Tue, 18 Jul 2023 14:35:36 +0200 Subject: [PATCH 03/13] Makes legacy item checks configurable and have it disabled by default The legacy checks is causing big performance problems on bigger servers. It will be removed in the future --- .../listeners/PlayerInteractListener.java | 9 +++++- .../epicvouchers/settings/Settings.java | 4 +++ .../songoda/epicvouchers/utils/CachedSet.java | 2 +- .../songoda/epicvouchers/voucher/Voucher.java | 32 ++++++++++++++++--- 4 files changed, 41 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java b/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java index 9219dac..6fb8477 100644 --- a/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java +++ b/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java @@ -2,6 +2,7 @@ package com.songoda.epicvouchers.listeners; import com.songoda.core.third_party.de.tr7zw.nbtapi.NBTItem; import com.songoda.epicvouchers.EpicVouchers; +import com.songoda.epicvouchers.settings.Settings; import com.songoda.epicvouchers.utils.CachedSet; import com.songoda.epicvouchers.voucher.Voucher; import org.bukkit.ChatColor; @@ -25,6 +26,8 @@ public class PlayerInteractListener implements Listener { @EventHandler public void voucherListener(PlayerInteractEvent e) { + boolean legacyCheckEnabled = Settings.CHECK_FOR_LEGACY_ITEMS.getBoolean(); + ItemStack item = e.getItem(); if (item == null || !isRightClickAction(e.getAction())) { return; @@ -33,7 +36,7 @@ public class PlayerInteractListener implements Listener { NBTItem nbtItem = new NBTItem(item); boolean itemHasVoucher = nbtItem.hasTag("epicvouchers:voucher"); - boolean itemHasBeenLegacyChecked = this.itemsThatGotLegacyChecked.contains(item); + boolean itemHasBeenLegacyChecked = !legacyCheckEnabled || this.itemsThatGotLegacyChecked.contains(item); if (!itemHasVoucher && itemHasBeenLegacyChecked) { return; } @@ -52,6 +55,10 @@ public class PlayerInteractListener implements Listener { return; } + if (!Settings.CHECK_FOR_LEGACY_ITEMS.getBoolean()) { + return; + } + voucher = findVoucherForLegacyItem(item, allVouchers); if (voucher == null) { this.itemsThatGotLegacyChecked.add(item); diff --git a/src/main/java/com/songoda/epicvouchers/settings/Settings.java b/src/main/java/com/songoda/epicvouchers/settings/Settings.java index 1034b6a..e0dd321 100644 --- a/src/main/java/com/songoda/epicvouchers/settings/Settings.java +++ b/src/main/java/com/songoda/epicvouchers/settings/Settings.java @@ -13,6 +13,10 @@ public class Settings implements Listener { public static final ConfigSetting FILL_GLASS = new ConfigSetting(config, "Interface.Fill Interfaces With Glass", true); public static final ConfigSetting COOLDOWN_DELAY = new ConfigSetting(config, "Main.Cooldown Delay", 10); + public static final ConfigSetting CHECK_FOR_LEGACY_ITEMS = new ConfigSetting(config, "Main.Check For Legacy Items", false, + "When you have a really old installation of EpicVouchers, some items in chests etc. might still be created with the old system.", + "This enables checking/detection for those items.", + "2 warnings: Enabling this comes with a performance impact with many vouchers configured + This check will be removed in the future"); public static final ConfigSetting DATABASE_SUPPORT = new ConfigSetting(config, "Database.Activate Mysql Support", false); public static final ConfigSetting DATABASE_IP = new ConfigSetting(config, "Database.IP", "127.0.0.1"); diff --git a/src/main/java/com/songoda/epicvouchers/utils/CachedSet.java b/src/main/java/com/songoda/epicvouchers/utils/CachedSet.java index a805a50..005a450 100644 --- a/src/main/java/com/songoda/epicvouchers/utils/CachedSet.java +++ b/src/main/java/com/songoda/epicvouchers/utils/CachedSet.java @@ -4,7 +4,7 @@ import java.util.Map; import java.util.WeakHashMap; public class CachedSet { - private final Map cache = new WeakHashMap<>(); + private final Map cache = new WeakHashMap<>(0); private final int ttl; private long lastClear = System.currentTimeMillis(); diff --git a/src/main/java/com/songoda/epicvouchers/voucher/Voucher.java b/src/main/java/com/songoda/epicvouchers/voucher/Voucher.java index 7dfb12b..75ede49 100644 --- a/src/main/java/com/songoda/epicvouchers/voucher/Voucher.java +++ b/src/main/java/com/songoda/epicvouchers/voucher/Voucher.java @@ -21,9 +21,9 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.UUID; -import java.util.stream.Collectors; import static org.bukkit.Material.PAPER; @@ -134,15 +134,39 @@ public class Voucher { } public List getLore(boolean applyFormatting) { - return applyFormatting ? lore.stream().map(TextUtils::formatText).collect(Collectors.toList()) : lore; + if (!applyFormatting) { + return Collections.unmodifiableList(this.lore); + } + + List lore = new ArrayList<>(); + for (String line : this.lore) { + lore.add(TextUtils.formatText(line)); + } + return lore; } public List getBroadcasts(boolean applyFormatting) { - return applyFormatting ? broadcasts.stream().map(TextUtils::formatText).collect(Collectors.toList()) : broadcasts; + if (!applyFormatting) { + return this.broadcasts; + } + + List result = new ArrayList<>(); + for (String broadcast : this.broadcasts) { + result.add(TextUtils.formatText(broadcast)); + } + return result; } public List getMessages(boolean applyFormatting) { - return applyFormatting ? messages.stream().map(TextUtils::formatText).collect(Collectors.toList()) : messages; + if (!applyFormatting) { + return this.messages; + } + + List list = new ArrayList<>(); + for (String message : this.messages) { + list.add(TextUtils.formatText(message)); + } + return list; } public void saveSetting(String key, List list) { From b63bd350c6a82b8d5703736f20ace278589104ad Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Tue, 18 Jul 2023 15:04:03 +0200 Subject: [PATCH 04/13] Heavy code style changes and slight refactoring --- .../songoda/epicvouchers/EpicVouchers.java | 117 +++++++++--------- .../epicvouchers/commands/CommandEditor.java | 4 +- .../commands/CommandEpicVouchers.java | 6 +- .../epicvouchers/commands/CommandForce.java | 13 +- .../commands/CommandForceAll.java | 11 +- .../epicvouchers/commands/CommandGive.java | 11 +- .../epicvouchers/commands/CommandGiveAll.java | 9 +- .../epicvouchers/commands/CommandList.java | 6 +- .../epicvouchers/commands/CommandReload.java | 6 +- .../epicvouchers/events/ForceRedeemEvent.java | 20 +-- .../events/VoucherReceiveEvent.java | 31 +++-- .../events/VoucherRedeemEvent.java | 23 ++-- .../epicvouchers/handlers/Connections.java | 22 ++-- .../epicvouchers/libraries/ItemBuilder.java | 79 ++++++------ .../libraries/inventory/FastInv.java | 93 ++++++-------- .../libraries/inventory/IconInv.java | 57 ++++----- .../libraries/inventory/PlayersMenu.java | 27 ++-- .../libraries/inventory/icons/Icon.java | 13 +- .../libraries/inventory/icons/StringIcon.java | 8 +- .../inventory/icons/ToggleableIcon.java | 9 +- .../listeners/PlayerInteractListener.java | 4 +- .../epicvouchers/menus/VoucherEditorMenu.java | 2 +- .../epicvouchers/menus/VoucherMenu.java | 2 +- .../menus/sub/editor/SoundsMenu.java | 1 - .../epicvouchers/settings/Settings.java | 5 +- .../songoda/epicvouchers/utils/CachedSet.java | 6 +- .../com/songoda/epicvouchers/utils/Pair.java | 26 ++-- .../epicvouchers/utils/ThreadSync.java | 14 +-- .../epicvouchers/voucher/CoolDownManager.java | 10 +- .../songoda/epicvouchers/voucher/Voucher.java | 71 +++++------ .../epicvouchers/voucher/VoucherExecutor.java | 19 ++- .../epicvouchers/voucher/VoucherManager.java | 10 +- src/main/resources/plugin.yml | 2 +- 33 files changed, 361 insertions(+), 376 deletions(-) diff --git a/src/main/java/com/songoda/epicvouchers/EpicVouchers.java b/src/main/java/com/songoda/epicvouchers/EpicVouchers.java index 6c7642d..698cfff 100644 --- a/src/main/java/com/songoda/epicvouchers/EpicVouchers.java +++ b/src/main/java/com/songoda/epicvouchers/EpicVouchers.java @@ -37,8 +37,6 @@ import java.util.Collections; import java.util.List; public class EpicVouchers extends SongodaPlugin { - private static EpicVouchers INSTANCE; - private final GuiManager guiManager = new GuiManager(this); private CommandManager commandManager; private VoucherManager voucherManager; @@ -48,18 +46,21 @@ public class EpicVouchers extends SongodaPlugin { private VoucherExecutor voucherExecutor; private final Config vouchersConfig = new Config(this, "vouchers.yml"); + /** + * @deprecated Use {@link org.bukkit.plugin.java.JavaPlugin#getPlugin(Class)} instead + */ + @Deprecated public static EpicVouchers getInstance() { - return INSTANCE; + return getPlugin(EpicVouchers.class); } @Override public void onPluginLoad() { - INSTANCE = this; } @Override public void onPluginDisable() { - connections.closeMySQL(); + this.connections.closeMySQL(); saveVouchers(); } @@ -96,7 +97,7 @@ public class EpicVouchers extends SongodaPlugin { PluginManager manager = Bukkit.getServer().getPluginManager(); // Listeners - guiManager.init(); + this.guiManager.init(); manager.registerEvents(new PlayerInteractListener(this), this); manager.registerEvents(new PlayerCommandListener(), this); } @@ -107,13 +108,13 @@ public class EpicVouchers extends SongodaPlugin { saveResource("vouchers.yml", false); } - synchronized (vouchersConfig) { - vouchersConfig.load(); + synchronized (this.vouchersConfig) { + this.vouchersConfig.load(); } loadVouchersFromFile(); - connections.openMySQL(); + this.connections.openMySQL(); // FIXME: Config system needs to be greatly redone and only write changes when changes were made - Maybe even split it into multiple smaler files // Issue https://support.songoda.com/browse/SD-8155 has been hotfixed by writing changes to the file async and blocking the main thread when needed. This requires the use of `synchronized` @@ -129,13 +130,13 @@ public class EpicVouchers extends SongodaPlugin { } private void loadVouchersFromFile() { - synchronized (vouchersConfig) { - voucherManager.clearVouchers(); + synchronized (this.vouchersConfig) { + this.voucherManager.clearVouchers(); - if (vouchersConfig.contains("vouchers")) { - for (String key : vouchersConfig.getConfigurationSection("vouchers").getKeys(false)) { + if (this.vouchersConfig.contains("vouchers")) { + for (String key : this.vouchersConfig.getConfigurationSection("vouchers").getKeys(false)) { Voucher voucher = new Voucher(key, this); - ConfigurationSection cs = vouchersConfig.getConfigurationSection("vouchers." + key); + ConfigurationSection cs = this.vouchersConfig.getConfigurationSection("vouchers." + key); Material material; String stringMaterial = cs.getString("material"); @@ -144,7 +145,9 @@ public class EpicVouchers extends SongodaPlugin { material = Material.PAPER; } else { material = Material.matchMaterial(stringMaterial); - if (material == null) material = Material.PAPER; + if (material == null) { + material = Material.PAPER; + } } voucher.setPermission(cs.getString("permission", "")) @@ -178,7 +181,7 @@ public class EpicVouchers extends SongodaPlugin { .setEffectAmplifier(cs.getInt("effects.amplifier")) .setItemStack(cs.getItemStack("itemstack", null)); - voucherManager.addVoucher(voucher); + this.voucherManager.addVoucher(voucher); } } } @@ -201,14 +204,14 @@ public class EpicVouchers extends SongodaPlugin { private void saveVouchersAsync(Callback callback) { new Thread(() -> { try { - synchronized (vouchersConfig) { - Collection voucherList = voucherManager.getVouchers(); + synchronized (this.vouchersConfig) { + Collection voucherList = this.voucherManager.getVouchers(); - ConfigurationSection cfgSec = vouchersConfig.getConfigurationSection("vouchers"); + ConfigurationSection cfgSec = this.vouchersConfig.getConfigurationSection("vouchers"); if (cfgSec != null) { for (String voucherName : cfgSec.getKeys(false)) { if (voucherList.stream().noneMatch(voucher -> voucher.getKey().equals(voucherName))) { - vouchersConfig.set("vouchers." + voucherName, null); + this.vouchersConfig.set("vouchers." + voucherName, null); } } } @@ -216,39 +219,39 @@ public class EpicVouchers extends SongodaPlugin { for (Voucher voucher : voucherList) { String prefix = "vouchers." + voucher.getKey() + "."; - vouchersConfig.set(prefix + "permission", voucher.getPermission()); - vouchersConfig.set(prefix + "material", voucher.getMaterial().name()); - vouchersConfig.set(prefix + "data", voucher.getData()); - vouchersConfig.set(prefix + "name", voucher.getName()); - vouchersConfig.set(prefix + "lore", voucher.getLore()); - vouchersConfig.set(prefix + "texture", voucher.getTexture()); - vouchersConfig.set(prefix + "glow", voucher.isGlow()); - vouchersConfig.set(prefix + "confirm", voucher.isConfirm()); - vouchersConfig.set(prefix + "unbreakable", voucher.isUnbreakable()); - vouchersConfig.set(prefix + "hide-attributes", voucher.isHideAttributes()); - vouchersConfig.set(prefix + "remove-item", voucher.isRemoveItem()); - vouchersConfig.set(prefix + "heal-player", voucher.isHealPlayer()); - vouchersConfig.set(prefix + "smite-effect", voucher.isSmiteEffect()); - vouchersConfig.set(prefix + "coolDown", voucher.getCoolDown()); - vouchersConfig.set(prefix + "broadcasts", voucher.getBroadcasts()); - vouchersConfig.set(prefix + "messages", voucher.getMessages()); - vouchersConfig.set(prefix + "commands", voucher.getCommands()); - vouchersConfig.set(prefix + "actionbar", voucher.getActionBar()); - vouchersConfig.set(prefix + "titles.title", voucher.getTitle()); - vouchersConfig.set(prefix + "titles.subtitle", voucher.getSubTitle()); - vouchersConfig.set(prefix + "titles.fade-in", voucher.getTitleFadeIn()); - vouchersConfig.set(prefix + "titles.stay", voucher.getTitleStay()); - vouchersConfig.set(prefix + "titles.fade-out", voucher.getTitleFadeOut()); - vouchersConfig.set(prefix + "sounds.sound", voucher.getSound()); - vouchersConfig.set(prefix + "sounds.pitch", voucher.getSoundPitch()); - vouchersConfig.set(prefix + "particles.particle", voucher.getParticle()); - vouchersConfig.set(prefix + "particles.amount", voucher.getParticleAmount()); - vouchersConfig.set(prefix + "effects.effect", voucher.getEffect()); - vouchersConfig.set(prefix + "effects.amplifier", voucher.getEffectAmplifier()); - vouchersConfig.set(prefix + "itemstack", voucher.getItemStack()); + this.vouchersConfig.set(prefix + "permission", voucher.getPermission()); + this.vouchersConfig.set(prefix + "material", voucher.getMaterial().name()); + this.vouchersConfig.set(prefix + "data", voucher.getData()); + this.vouchersConfig.set(prefix + "name", voucher.getName()); + this.vouchersConfig.set(prefix + "lore", voucher.getLore()); + this.vouchersConfig.set(prefix + "texture", voucher.getTexture()); + this.vouchersConfig.set(prefix + "glow", voucher.isGlow()); + this.vouchersConfig.set(prefix + "confirm", voucher.isConfirm()); + this.vouchersConfig.set(prefix + "unbreakable", voucher.isUnbreakable()); + this.vouchersConfig.set(prefix + "hide-attributes", voucher.isHideAttributes()); + this.vouchersConfig.set(prefix + "remove-item", voucher.isRemoveItem()); + this.vouchersConfig.set(prefix + "heal-player", voucher.isHealPlayer()); + this.vouchersConfig.set(prefix + "smite-effect", voucher.isSmiteEffect()); + this.vouchersConfig.set(prefix + "coolDown", voucher.getCoolDown()); + this.vouchersConfig.set(prefix + "broadcasts", voucher.getBroadcasts()); + this.vouchersConfig.set(prefix + "messages", voucher.getMessages()); + this.vouchersConfig.set(prefix + "commands", voucher.getCommands()); + this.vouchersConfig.set(prefix + "actionbar", voucher.getActionBar()); + this.vouchersConfig.set(prefix + "titles.title", voucher.getTitle()); + this.vouchersConfig.set(prefix + "titles.subtitle", voucher.getSubTitle()); + this.vouchersConfig.set(prefix + "titles.fade-in", voucher.getTitleFadeIn()); + this.vouchersConfig.set(prefix + "titles.stay", voucher.getTitleStay()); + this.vouchersConfig.set(prefix + "titles.fade-out", voucher.getTitleFadeOut()); + this.vouchersConfig.set(prefix + "sounds.sound", voucher.getSound()); + this.vouchersConfig.set(prefix + "sounds.pitch", voucher.getSoundPitch()); + this.vouchersConfig.set(prefix + "particles.particle", voucher.getParticle()); + this.vouchersConfig.set(prefix + "particles.amount", voucher.getParticleAmount()); + this.vouchersConfig.set(prefix + "effects.effect", voucher.getEffect()); + this.vouchersConfig.set(prefix + "effects.amplifier", voucher.getEffectAmplifier()); + this.vouchersConfig.set(prefix + "itemstack", voucher.getItemStack()); } - vouchersConfig.saveChanges(); + this.vouchersConfig.saveChanges(); callback.accept(null); } @@ -260,8 +263,8 @@ public class EpicVouchers extends SongodaPlugin { @Override public void onConfigReload() { - synchronized (vouchersConfig) { - vouchersConfig.load(); + synchronized (this.vouchersConfig) { + this.vouchersConfig.load(); } loadVouchersFromFile(); @@ -272,7 +275,7 @@ public class EpicVouchers extends SongodaPlugin { @Override public List getExtraConfig() { - return Collections.singletonList(vouchersConfig); + return Collections.singletonList(this.vouchersConfig); } public Connections getConnections() { @@ -288,14 +291,14 @@ public class EpicVouchers extends SongodaPlugin { } public CommandManager getCommandManager() { - return commandManager; + return this.commandManager; } public VoucherManager getVoucherManager() { - return voucherManager; + return this.voucherManager; } public GuiManager getGuiManager() { - return guiManager; + return this.guiManager; } } diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandEditor.java b/src/main/java/com/songoda/epicvouchers/commands/CommandEditor.java index d50de7b..64e81d0 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandEditor.java +++ b/src/main/java/com/songoda/epicvouchers/commands/CommandEditor.java @@ -12,13 +12,13 @@ public class CommandEditor extends AbstractCommand { final EpicVouchers instance; public CommandEditor(EpicVouchers instance) { - super(true, "editor"); + super(CommandType.PLAYER_ONLY, "EpicVouchers"); this.instance = instance; } @Override protected ReturnType runCommand(CommandSender sender, String... args) { - new VoucherMenu(instance).open((Player) sender); + new VoucherMenu(this.instance).open((Player) sender); return ReturnType.SUCCESS; } diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandEpicVouchers.java b/src/main/java/com/songoda/epicvouchers/commands/CommandEpicVouchers.java index 3867759..2672e77 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandEpicVouchers.java +++ b/src/main/java/com/songoda/epicvouchers/commands/CommandEpicVouchers.java @@ -11,17 +11,17 @@ public class CommandEpicVouchers extends AbstractCommand { final EpicVouchers instance; public CommandEpicVouchers(EpicVouchers instance) { - super(false, "EpicVouchers"); + super(CommandType.CONSOLE_OK, "EpicVouchers"); this.instance = instance; } @Override protected ReturnType runCommand(CommandSender sender, String... args) { sender.sendMessage(""); - instance.getLocale().newMessage("&7Version " + instance.getDescription().getVersion() + this.instance.getLocale().newMessage("&7Version " + this.instance.getDescription().getVersion() + " Created with <3 by &5&l&oSongoda").sendPrefixedMessage(sender); - for (AbstractCommand command : instance.getCommandManager().getAllCommands()) { + for (AbstractCommand command : this.instance.getCommandManager().getAllCommands()) { if (command.getPermissionNode() == null || sender.hasPermission(command.getPermissionNode())) { sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&8 - &a" + command.getSyntax() + "&7 - " + command.getDescription())); } diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandForce.java b/src/main/java/com/songoda/epicvouchers/commands/CommandForce.java index a909a65..89dd9e0 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandForce.java +++ b/src/main/java/com/songoda/epicvouchers/commands/CommandForce.java @@ -15,29 +15,30 @@ public class CommandForce extends AbstractCommand { final EpicVouchers instance; public CommandForce(EpicVouchers instance) { - super(false, "force"); + super(CommandType.CONSOLE_OK, "force"); this.instance = instance; } @Override protected ReturnType runCommand(CommandSender sender, String... args) { - if (args.length != 3) + if (args.length != 3) { return ReturnType.SYNTAX_ERROR; + } Player player = Bukkit.getPlayer(args[0]); if (Bukkit.getPlayer(args[0]) == null) { - instance.getLocale().newMessage("&cThat player does not exist or is currently offline.").sendPrefixedMessage(sender); + this.instance.getLocale().newMessage("&cThat player does not exist or is currently offline.").sendPrefixedMessage(sender); return ReturnType.FAILURE; } - Voucher voucher = instance.getVoucherManager().getVoucher(args[1]); + Voucher voucher = this.instance.getVoucherManager().getVoucher(args[1]); if (voucher == null) { sender.sendMessage("Unknown voucher..."); return ReturnType.FAILURE; } voucher.forceRedeem(sender, Collections.singletonList(player), Integer.parseInt(args[2])); - instance.getLocale().getMessage("command.force.send") + this.instance.getLocale().getMessage("command.force.send") .processPlaceholder("player", player.getName()) .processPlaceholder("voucher", voucher.getName(true)) .processPlaceholder("amount", args[2].trim()) @@ -54,7 +55,7 @@ public class CommandForce extends AbstractCommand { result.add(online.getName()); } } else if (args.length == 2) { - for (Voucher voucher : instance.getVoucherManager().getVouchers()) { + for (Voucher voucher : this.instance.getVoucherManager().getVouchers()) { result.add(voucher.getKey()); } } else if (args.length == 3) { diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandForceAll.java b/src/main/java/com/songoda/epicvouchers/commands/CommandForceAll.java index 9ee6edd..564fe44 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandForceAll.java +++ b/src/main/java/com/songoda/epicvouchers/commands/CommandForceAll.java @@ -13,23 +13,24 @@ public class CommandForceAll extends AbstractCommand { final EpicVouchers instance; public CommandForceAll(EpicVouchers instance) { - super(false, "forceall"); + super(CommandType.CONSOLE_OK, "forceall"); this.instance = instance; } @Override protected ReturnType runCommand(CommandSender sender, String... args) { - if (args.length != 2) + if (args.length != 2) { return ReturnType.SYNTAX_ERROR; + } - Voucher voucher = instance.getVoucherManager().getVoucher(args[0]); + Voucher voucher = this.instance.getVoucherManager().getVoucher(args[0]); if (voucher == null) { sender.sendMessage("Unknown voucher..."); return ReturnType.FAILURE; } voucher.forceRedeem(sender, new ArrayList<>(Bukkit.getOnlinePlayers()), Integer.parseInt(args[1])); - instance.getLocale().getMessage("command.force.send") + this.instance.getLocale().getMessage("command.force.send") .processPlaceholder("player", "everyone") .processPlaceholder("voucher", voucher.getName(true)) .processPlaceholder("amount", args[1].trim()) @@ -42,7 +43,7 @@ public class CommandForceAll extends AbstractCommand { List result = new ArrayList<>(); if (args.length == 1) { - for (Voucher voucher : instance.getVoucherManager().getVouchers()) { + for (Voucher voucher : this.instance.getVoucherManager().getVouchers()) { result.add(voucher.getKey()); } } else if (args.length == 2) { diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandGive.java b/src/main/java/com/songoda/epicvouchers/commands/CommandGive.java index c7a6144..c0bae2e 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandGive.java +++ b/src/main/java/com/songoda/epicvouchers/commands/CommandGive.java @@ -15,22 +15,23 @@ public class CommandGive extends AbstractCommand { final EpicVouchers instance; public CommandGive(EpicVouchers instance) { - super(false, "give"); + super(CommandType.CONSOLE_OK, "give"); this.instance = instance; } @Override protected ReturnType runCommand(CommandSender sender, String... args) { - if (args.length != 3) + if (args.length != 3) { return ReturnType.SYNTAX_ERROR; + } Player player = Bukkit.getPlayer(args[0]); if (Bukkit.getPlayer(args[0]) == null) { - instance.getLocale().newMessage("&cThat player does not exist or is currently offline.").sendPrefixedMessage(sender); + this.instance.getLocale().newMessage("&cThat player does not exist or is currently offline.").sendPrefixedMessage(sender); return ReturnType.FAILURE; } - Voucher voucher = instance.getVoucherManager().getVoucher(args[1]); + Voucher voucher = this.instance.getVoucherManager().getVoucher(args[1]); if (voucher == null) { sender.sendMessage("Unknown voucher..."); return ReturnType.FAILURE; @@ -49,7 +50,7 @@ public class CommandGive extends AbstractCommand { result.add(online.getName()); } } else if (args.length == 2) { - for (Voucher voucher : instance.getVoucherManager().getVouchers()) { + for (Voucher voucher : this.instance.getVoucherManager().getVouchers()) { result.add(voucher.getKey()); } } else if (args.length == 3) { diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandGiveAll.java b/src/main/java/com/songoda/epicvouchers/commands/CommandGiveAll.java index 51250be..a876146 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandGiveAll.java +++ b/src/main/java/com/songoda/epicvouchers/commands/CommandGiveAll.java @@ -12,16 +12,17 @@ public class CommandGiveAll extends AbstractCommand { final EpicVouchers instance; public CommandGiveAll(EpicVouchers instance) { - super(false, "giveall"); + super(CommandType.CONSOLE_OK, "giveall"); this.instance = instance; } @Override protected ReturnType runCommand(CommandSender sender, String... args) { - if (args.length != 2) + if (args.length != 2) { return ReturnType.SYNTAX_ERROR; + } - Voucher voucher = instance.getVoucherManager().getVoucher(args[0]); + Voucher voucher = this.instance.getVoucherManager().getVoucher(args[0]); if (voucher == null) { sender.sendMessage("Unknown voucher..."); return ReturnType.FAILURE; @@ -36,7 +37,7 @@ public class CommandGiveAll extends AbstractCommand { List result = new ArrayList<>(); if (args.length == 1) { - for (Voucher voucher : instance.getVoucherManager().getVouchers()) { + for (Voucher voucher : this.instance.getVoucherManager().getVouchers()) { result.add(voucher.getKey()); } } else if (args.length == 2) { diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandList.java b/src/main/java/com/songoda/epicvouchers/commands/CommandList.java index deea3f5..d53a307 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandList.java +++ b/src/main/java/com/songoda/epicvouchers/commands/CommandList.java @@ -12,18 +12,18 @@ public class CommandList extends AbstractCommand { final EpicVouchers instance; public CommandList(EpicVouchers instance) { - super(false, "list"); + super(CommandType.CONSOLE_OK, "list"); this.instance = instance; } @Override protected ReturnType runCommand(CommandSender sender, String... args) { StringJoiner joiner = new StringJoiner(", "); - for (Voucher voucher : instance.getVoucherManager().getVouchers()) { + for (Voucher voucher : this.instance.getVoucherManager().getVouchers()) { joiner.add(voucher.getKey()); } - instance.getLocale().getMessage("command.list.list") + this.instance.getLocale().getMessage("command.list.list") .processPlaceholder("list", joiner.toString()) .sendPrefixedMessage(sender); diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandReload.java b/src/main/java/com/songoda/epicvouchers/commands/CommandReload.java index f1c458b..c304790 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandReload.java +++ b/src/main/java/com/songoda/epicvouchers/commands/CommandReload.java @@ -10,14 +10,14 @@ public class CommandReload extends AbstractCommand { final EpicVouchers instance; public CommandReload(EpicVouchers instance) { - super(false, "reload"); + super(CommandType.CONSOLE_OK, "reload"); this.instance = instance; } @Override protected ReturnType runCommand(CommandSender sender, String... args) { - instance.reloadConfig(); - instance.getLocale().getMessage("&7Configuration and Language files reloaded.").sendPrefixedMessage(sender); + this.instance.reloadConfig(); + this.instance.getLocale().getMessage("&7Configuration and Language files reloaded.").sendPrefixedMessage(sender); return ReturnType.SUCCESS; } diff --git a/src/main/java/com/songoda/epicvouchers/events/ForceRedeemEvent.java b/src/main/java/com/songoda/epicvouchers/events/ForceRedeemEvent.java index 639a177..468d510 100644 --- a/src/main/java/com/songoda/epicvouchers/events/ForceRedeemEvent.java +++ b/src/main/java/com/songoda/epicvouchers/events/ForceRedeemEvent.java @@ -7,7 +7,7 @@ import org.bukkit.event.Event; import org.bukkit.event.HandlerList; public class ForceRedeemEvent extends Event implements Cancellable { - private static final HandlerList handlers = new HandlerList(); + private static final HandlerList HANDLER_LIST = new HandlerList(); private final Player player; private final String voucher; @@ -24,35 +24,35 @@ public class ForceRedeemEvent extends Event implements Cancellable { } public Player getPlayer() { - return player; + return this.player; } public String getVoucher() { - return voucher; + return this.voucher; } public int getAmount() { - return amount; + return this.amount; } public CommandSender getSender() { - return sender; + return this.sender; } public boolean isCancelled() { - return cancelled; + return this.cancelled; } - public void setCancelled(boolean cancelled) { - this.cancelled = cancelled; + public void setCancelled(boolean cancel) { + this.cancelled = cancel; } @Override public HandlerList getHandlers() { - return handlers; + return HANDLER_LIST; } public static HandlerList getHandlerList() { - return handlers; + return HANDLER_LIST; } } diff --git a/src/main/java/com/songoda/epicvouchers/events/VoucherReceiveEvent.java b/src/main/java/com/songoda/epicvouchers/events/VoucherReceiveEvent.java index 78daf88..a93638c 100644 --- a/src/main/java/com/songoda/epicvouchers/events/VoucherReceiveEvent.java +++ b/src/main/java/com/songoda/epicvouchers/events/VoucherReceiveEvent.java @@ -8,8 +8,7 @@ import org.bukkit.event.HandlerList; import org.bukkit.inventory.ItemStack; public class VoucherReceiveEvent extends Event implements Cancellable { - - private static final HandlerList handlers = new HandlerList(); + private static final HandlerList HANDLER_LIST = new HandlerList(); private final Player player; private final String voucher; @@ -28,39 +27,39 @@ public class VoucherReceiveEvent extends Event implements Cancellable { } public Player getPlayer() { - return player; + return this.player; } public String getVoucher() { - return voucher; + return this.voucher; } public ItemStack getItem() { - return item; + return this.item; } public int getAmount() { - return amount; + return this.amount; } public CommandSender getSender() { - return sender; + return this.sender; } public boolean isCancelled() { - return cancelled; + return this.cancelled; } - public void setCancelled(boolean cancelled) { - this.cancelled = cancelled; + public void setCancelled(boolean cancel) { + this.cancelled = cancel; } public HandlerList getHandlers() { - return handlers; - } - - public static HandlerList getHandlerList() { - return handlers; + return HANDLER_LIST; } -} \ No newline at end of file + public static HandlerList getHandlerList() { + return HANDLER_LIST; + } + +} diff --git a/src/main/java/com/songoda/epicvouchers/events/VoucherRedeemEvent.java b/src/main/java/com/songoda/epicvouchers/events/VoucherRedeemEvent.java index c4c0e37..fb846d7 100644 --- a/src/main/java/com/songoda/epicvouchers/events/VoucherRedeemEvent.java +++ b/src/main/java/com/songoda/epicvouchers/events/VoucherRedeemEvent.java @@ -7,8 +7,7 @@ import org.bukkit.event.HandlerList; import org.bukkit.inventory.ItemStack; public class VoucherRedeemEvent extends Event implements Cancellable { - - private static final HandlerList handlers = new HandlerList(); + private static final HandlerList HANDLER_LIST = new HandlerList(); private final Player player; private final String voucher; @@ -25,35 +24,35 @@ public class VoucherRedeemEvent extends Event implements Cancellable { } public Player getPlayer() { - return player; + return this.player; } public String getVoucher() { - return voucher; + return this.voucher; } public ItemStack getItem() { - return item; + return this.item; } public boolean getManual() { - return manual; + return this.manual; } public boolean isCancelled() { - return cancelled; + return this.cancelled; } - public void setCancelled(boolean cancelled) { - this.cancelled = cancelled; + public void setCancelled(boolean cancel) { + this.cancelled = cancel; } public HandlerList getHandlers() { - return handlers; + return HANDLER_LIST; } public static HandlerList getHandlerList() { - return handlers; + return HANDLER_LIST; } -} \ No newline at end of file +} diff --git a/src/main/java/com/songoda/epicvouchers/handlers/Connections.java b/src/main/java/com/songoda/epicvouchers/handlers/Connections.java index 759eed2..be43d64 100644 --- a/src/main/java/com/songoda/epicvouchers/handlers/Connections.java +++ b/src/main/java/com/songoda/epicvouchers/handlers/Connections.java @@ -19,17 +19,17 @@ public class Connections { } public void openMySQL() { - if (!instance.getConfig().getBoolean("Database.Activate Mysql Support") || connection == null) { + if (!this.instance.getConfig().getBoolean("Database.Activate Mysql Support") || this.connection == null) { return; } try { - String mysqlIP = instance.getConfig().getString("Database.IP"); - String mysqlPort = instance.getConfig().getString("Database.PORT"); - String mysqlDatabase = instance.getConfig().getString("Database.Database Name"); - String mysqlUsername = instance.getConfig().getString("Database.Username"); - String mysqlPassword = instance.getConfig().getString("Database.Password"); + String mysqlIP = this.instance.getConfig().getString("Database.IP"); + String mysqlPort = this.instance.getConfig().getString("Database.PORT"); + String mysqlDatabase = this.instance.getConfig().getString("Database.Database Name"); + String mysqlUsername = this.instance.getConfig().getString("Database.Username"); + String mysqlPassword = this.instance.getConfig().getString("Database.Password"); - connection = DriverManager.getConnection("jdbc:mysql://" + mysqlIP + ":" + mysqlPort + "/" + mysqlDatabase + "?useSSL=true?autoReconnect=true", mysqlUsername, mysqlPassword); + this.connection = DriverManager.getConnection("jdbc:mysql://" + mysqlIP + ":" + mysqlPort + "/" + mysqlDatabase + "?useSSL=true?autoReconnect=true", mysqlUsername, mysqlPassword); System.out.println(TextUtils.formatText("&fSuccessfully created a connection with MySQL.")); } catch (Exception error) { System.out.println(TextUtils.formatText("&cFailed to create a connection with MySQL.")); @@ -38,11 +38,11 @@ public class Connections { } public void closeMySQL() { - if (!instance.getConfig().getBoolean("Database.Activate Mysql Support") || connection == null) { + if (!this.instance.getConfig().getBoolean("Database.Activate Mysql Support") || this.connection == null) { return; } try { - connection.close(); + this.connection.close(); System.out.println(TextUtils.formatText("&fSuccessfully closed the MySQL connection.")); } catch (Exception error) { System.out.println(TextUtils.formatText("&cFailed to close the MySQL connection.")); @@ -51,14 +51,14 @@ public class Connections { } public void saveRedeem(Player player, String voucher) { - if (!instance.getConfig().getBoolean("Database.Activate Mysql Support") || connection == null) { + if (!this.instance.getConfig().getBoolean("Database.Activate Mysql Support") || this.connection == null) { return; } Timestamp stamp = new Timestamp(System.currentTimeMillis()); Date date = new Date(stamp.getTime()); String time = date.toString(); try { - Statement statement = connection.createStatement(); + Statement statement = this.connection.createStatement(); statement.execute("CREATE TABLE IF NOT EXISTS redeems (id INT NOT NULL AUTO_INCREMENT, player varchar(120) NOT NULL, voucher varchar(120) NOT NULL, timestamp varchar(120) NOT NULL, PRIMARY KEY (ID));"); statement.execute("INSERT INTO redeems VALUES (default, '" + player.getName() + "', '" + voucher + "', '" + time + "');"); statement.close(); diff --git a/src/main/java/com/songoda/epicvouchers/libraries/ItemBuilder.java b/src/main/java/com/songoda/epicvouchers/libraries/ItemBuilder.java index 6585e6b..a533f2a 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/ItemBuilder.java +++ b/src/main/java/com/songoda/epicvouchers/libraries/ItemBuilder.java @@ -63,7 +63,7 @@ public class ItemBuilder { } public ItemMeta getMeta() { - return meta; + return this.meta; } public ItemBuilder meta(ItemMeta meta) { @@ -75,15 +75,15 @@ public class ItemBuilder { * Name: */ public boolean hasName() { - return meta.hasDisplayName(); + return this.meta.hasDisplayName(); } public String getName() { - return meta.getDisplayName(); + return this.meta.getDisplayName(); } public ItemBuilder name(String name) { - meta.setDisplayName(name); + this.meta.setDisplayName(name); return this; } @@ -91,11 +91,11 @@ public class ItemBuilder { * Lore: */ public boolean hasLore() { - return meta.hasLore(); + return this.meta.hasLore(); } public List getLore() { - return meta.getLore(); + return this.meta.getLore(); } public ItemBuilder lore(String... lore) { @@ -103,7 +103,7 @@ public class ItemBuilder { } public ItemBuilder lore(List lore) { - meta.setLore(lore); + this.meta.setLore(lore); return this; } @@ -111,28 +111,28 @@ public class ItemBuilder { * Enchantments: */ public boolean hasEnchants() { - return meta.hasEnchants(); + return this.meta.hasEnchants(); } public boolean hasEnchant(Enchantment enchantment) { - return meta.hasEnchant(enchantment); + return this.meta.hasEnchant(enchantment); } public boolean hasConflictingEnchant(Enchantment enchantment) { - return meta.hasConflictingEnchant(enchantment); + return this.meta.hasConflictingEnchant(enchantment); } public Map getEnchants() { - return meta.getEnchants(); + return this.meta.getEnchants(); } public ItemBuilder enchant(Enchantment enchantment, int level) { - meta.addEnchant(enchantment, level, true); + this.meta.addEnchant(enchantment, level, true); return this; } public ItemBuilder removeEnchant(Enchantment enchantment) { - meta.removeEnchant(enchantment); + this.meta.removeEnchant(enchantment); return this; } @@ -144,20 +144,20 @@ public class ItemBuilder { * Flags: */ public boolean hasFlag(ItemFlag flag) { - return meta.hasItemFlag(flag); + return this.meta.hasItemFlag(flag); } public Set getFlags() { - return meta.getItemFlags(); + return this.meta.getItemFlags(); } public ItemBuilder addFlags(ItemFlag... flags) { - meta.addItemFlags(flags); + this.meta.addItemFlags(flags); return this; } public ItemBuilder removeFlags(ItemFlag... flags) { - meta.removeItemFlags(flags); + this.meta.removeItemFlags(flags); return this; } @@ -165,16 +165,15 @@ public class ItemBuilder { * Unbreakability: */ public boolean isUnbreakable() { - return meta.isUnbreakable(); + return this.meta.isUnbreakable(); } public ItemBuilder unbreakable() { return unbreakable(true); } - @SuppressWarnings("deprecation") public ItemBuilder unbreakable(boolean unbreakable) { - meta.setUnbreakable(unbreakable); + this.meta.setUnbreakable(unbreakable); return this; } @@ -190,36 +189,36 @@ public class ItemBuilder { * Banners: */ public DyeColor getBannerBaseColor() { - return ((BannerMeta) meta).getBaseColor(); + return ((BannerMeta) this.meta).getBaseColor(); } public List getBannerPatterns() { - return ((BannerMeta) meta).getPatterns(); + return ((BannerMeta) this.meta).getPatterns(); } @SuppressWarnings("deprecation") public ItemBuilder bannerBaseColor(DyeColor color) { - ((BannerMeta) meta).setBaseColor(color); + ((BannerMeta) this.meta).setBaseColor(color); return this; } public ItemBuilder bannerPatterns(List patterns) { - ((BannerMeta) meta).setPatterns(patterns); + ((BannerMeta) this.meta).setPatterns(patterns); return this; } public ItemBuilder bannerPattern(int i, Pattern pattern) { - ((BannerMeta) meta).setPattern(i, pattern); + ((BannerMeta) this.meta).setPattern(i, pattern); return this; } public ItemBuilder addBannerPatterns(Pattern pattern) { - ((BannerMeta) meta).addPattern(pattern); + ((BannerMeta) this.meta).addPattern(pattern); return this; } public ItemBuilder removeBannerPattern(int i) { - ((BannerMeta) meta).removePattern(i); + ((BannerMeta) this.meta).removePattern(i); return this; } @@ -227,11 +226,11 @@ public class ItemBuilder { * Leather armor: */ public Color getLeatherArmorColor() { - return ((LeatherArmorMeta) meta).getColor(); + return ((LeatherArmorMeta) this.meta).getColor(); } public ItemBuilder leatherArmorColor(Color color) { - ((LeatherArmorMeta) meta).setColor(color); + ((LeatherArmorMeta) this.meta).setColor(color); return this; } @@ -239,23 +238,23 @@ public class ItemBuilder { * Skulls: */ public boolean hasSkullOwner() { - return ((SkullMeta) meta).hasOwner(); + return ((SkullMeta) this.meta).hasOwner(); } @SuppressWarnings("deprecation") public String getSkullOwner() { - return ((SkullMeta) meta).getOwner(); + return ((SkullMeta) this.meta).getOwner(); } @SuppressWarnings("deprecation") public ItemBuilder skullOwner(String owner) { - item.setDurability((short) 3); - ((SkullMeta) meta).setOwner(owner); + this.item.setDurability((short) 3); + ((SkullMeta) this.meta).setOwner(owner); return this; } public ItemBuilder durability(int durability) { - item.setDurability((short) durability); + this.item.setDurability((short) durability); return this; } @@ -263,19 +262,19 @@ public class ItemBuilder { * Potions: */ public boolean hasPotionEffect(PotionEffectType type) { - return ((PotionMeta) meta).hasCustomEffect(type); + return ((PotionMeta) this.meta).hasCustomEffect(type); } public boolean hasPotionEffects() { - return ((PotionMeta) meta).hasCustomEffects(); + return ((PotionMeta) this.meta).hasCustomEffects(); } public List getPotionEffects() { - return ((PotionMeta) meta).getCustomEffects(); + return ((PotionMeta) this.meta).getCustomEffects(); } public ItemBuilder addPotionEffect(PotionEffect effect, boolean overwrite) { - ((PotionMeta) meta).addCustomEffect(effect, overwrite); + ((PotionMeta) this.meta).addCustomEffect(effect, overwrite); return this; } @@ -283,7 +282,7 @@ public class ItemBuilder { * Build the ItemStack. */ public ItemStack build() { - item.setItemMeta(meta); - return item; + this.item.setItemMeta(this.meta); + return this.item; } } diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/FastInv.java b/src/main/java/com/songoda/epicvouchers/libraries/inventory/FastInv.java index f114ece..09e8999 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/FastInv.java +++ b/src/main/java/com/songoda/epicvouchers/libraries/inventory/FastInv.java @@ -70,7 +70,6 @@ public class FastInv implements InventoryHolder { * * @param type The type of the menus. * @param title The title of the menus. - * * @throws IllegalStateException if FastInv is not init with FastInv.init(Plugin plugin) */ public FastInv(InventoryType type, String title) { @@ -84,9 +83,9 @@ public class FastInv implements InventoryHolder { runSync(() -> { if (type == InventoryType.CHEST && size > 0) { - inventory = Bukkit.createInventory(this, size, title); + this.inventory = Bukkit.createInventory(this, size, title); } else { - inventory = Bukkit.createInventory(this, type, title); + this.inventory = Bukkit.createInventory(this, type, title); } }); } @@ -107,7 +106,6 @@ public class FastInv implements InventoryHolder { * Add an {@link ItemStack} to the menus. * * @param item The item to add - * * @return This FastInv instance, for chaining. */ public FastInv addItem(ItemStack item) { @@ -119,12 +117,11 @@ public class FastInv implements InventoryHolder { * * @param item The item to add. * @param listener The {@link FastInvClickListener} for the item. - * * @return This FastInv instance, for chaining. */ public FastInv addItem(ItemStack item, FastInvClickListener listener) { runSync(() -> { - int slot = inventory.firstEmpty(); + int slot = this.inventory.firstEmpty(); if (slot >= 0) { addItem(slot, item, listener); } @@ -135,13 +132,12 @@ public class FastInv implements InventoryHolder { /** * Add an {@link ItemStack} to the menus on a specific slot. * - * @param slot The slot of the item. - * @param item The item to add. - * + * @param slot The slot of the item. + * @param itemStack The item to add. * @return This FastInv instance, for chaining. */ - public FastInv addItem(int slot, ItemStack item) { - return addItem(slot, item, null); + public FastInv addItem(int slot, ItemStack itemStack) { + return addItem(slot, itemStack, null); } /** @@ -149,17 +145,16 @@ public class FastInv implements InventoryHolder { * * @param slot The slot of the item. * @param itemStack The icon to add. - * * @return This FastInv instance, for chaining. */ public FastInv addItem(int slot, ItemStack itemStack, FastInvClickListener listener) { runSync(() -> { - inventory.setItem(slot, itemStack); + this.inventory.setItem(slot, itemStack); if (listener != null) { - itemListeners.put(slot, listener); + this.itemListeners.put(slot, listener); } else { - itemListeners.remove(slot); + this.itemListeners.remove(slot); } }); @@ -169,29 +164,27 @@ public class FastInv implements InventoryHolder { /** * Add an {@link ItemStack} to the menus on a range of slots. * - * @param slotFrom Starting slot to put the item in. - * @param slotTo Ending slot to put the item in. - * @param item The item to add. - * + * @param slotFrom Starting slot to put the item in. + * @param slotTo Ending slot to put the item in. + * @param itemStack The item to add. * @return This FastInv instance, for chaining. */ - public FastInv addItem(int slotFrom, int slotTo, ItemStack item) { - return addItem(slotFrom, slotTo, item, null); + public FastInv addItem(int slotFrom, int slotTo, ItemStack itemStack) { + return addItem(slotFrom, slotTo, itemStack, null); } /** * Add an {@link ItemStack} to the menus on a range of slots with a {@link FastInvClickListener} to handle clicks. * - * @param slotFrom Starting slot to put the item in. - * @param slotTo Ending slot to put the item in. - * @param item The item to add. - * @param listener The IconClickListener for the item. - * + * @param slotFrom Starting slot to put the item in. + * @param slotTo Ending slot to put the item in. + * @param itemStack The item to add. + * @param listener The IconClickListener for the item. * @return This FastInv instance, for chaining. */ - public FastInv addItem(int slotFrom, int slotTo, ItemStack item, FastInvClickListener listener) { + public FastInv addItem(int slotFrom, int slotTo, ItemStack itemStack, FastInvClickListener listener) { for (int i = slotFrom; i <= slotTo; i++) { - addItem(i, item, listener); + addItem(i, itemStack, listener); } return this; } @@ -201,7 +194,6 @@ public class FastInv implements InventoryHolder { * * @param slots The slot of the item. * @param item The item to add. - * * @return This FastInv instance, for chaining. */ public FastInv addItem(int[] slots, ItemStack item) { @@ -212,14 +204,13 @@ public class FastInv implements InventoryHolder { * Add an {@link ItemStack} to the menus on the edges. * * @param item The item to add. - * * @return This FastInv instance, for chaining. */ public FastInv edge(ItemStack item) { - int height = inventory.getSize() / 9; + int height = this.inventory.getSize() / 9; addItem(0, 9, item); - addItem(inventory.getSize() - 9, inventory.getSize() - 1, item); + addItem(this.inventory.getSize() - 9, this.inventory.getSize() - 1, item); for (int i = 0; i < height; i++) { addItem(i * 9, item); @@ -235,7 +226,6 @@ public class FastInv implements InventoryHolder { * @param slots The slots to place the item. * @param item The item to add. * @param listener The IconClickListener for the item. - * * @return This FastInv instance, for chaining. */ public FastInv addItem(int[] slots, ItemStack item, FastInvClickListener listener) { @@ -247,8 +237,8 @@ public class FastInv implements InventoryHolder { public FastInv fill(ItemStack itemStack, FastInvClickListener listener) { runSync(() -> { - for (int i = 0; i < inventory.getSize(); i++) { - if (inventory.getItem(i) == null) { + for (int i = 0; i < this.inventory.getSize(); i++) { + if (this.inventory.getItem(i) == null) { addItem(i, itemStack, listener); } } @@ -264,11 +254,10 @@ public class FastInv implements InventoryHolder { * Add a {@link FastInvCloseListener} to listen on menus close. * * @param listener The {@link FastInvCloseListener} to add. - * * @return This FastInv instance, for chaining. */ public FastInv onClose(FastInvCloseListener listener) { - closeListeners.add(listener); + this.closeListeners.add(listener); return this; } @@ -276,21 +265,20 @@ public class FastInv implements InventoryHolder { * Add a {@link FastInvClickListener} to listen on menus click. * * @param listener The {@link FastInvClickListener} to add. - * * @return This FastInv instance, for chaining. */ public FastInv onClick(FastInvClickListener listener) { - clickListeners.add(listener); + this.clickListeners.add(listener); return this; } public FastInv setDefaultCancel(boolean value) { - cancelled = value; + this.cancelled = value; return this; } public boolean getDefaultCancel() { - return cancelled; + return this.cancelled; } /** @@ -298,7 +286,6 @@ public class FastInv implements InventoryHolder { * * @param period Delay between each run. * @param runnable The {@link Runnable} task to run. - * * @return This FastInv instance, for chaining. */ public FastInv onUpdate(long period, Runnable runnable) { @@ -311,11 +298,10 @@ public class FastInv implements InventoryHolder { * @param delay Ticks to wait before starting the task. * @param period Delay between each run. * @param runnable The {@link Runnable} task to run. - * * @return This FastInv instance, for chaining */ public FastInv onUpdate(long delay, long period, Runnable runnable) { - tasks.add(Bukkit.getScheduler().runTaskTimer(plugin, runnable, delay, period)); + this.tasks.add(Bukkit.getScheduler().runTaskTimer(plugin, runnable, delay, period)); return this; } @@ -325,7 +311,7 @@ public class FastInv implements InventoryHolder { * @param player The player to open the menu. */ public void open(Player player) { - Bukkit.getScheduler().runTask(plugin, () -> player.openInventory(inventory)); + Bukkit.getScheduler().runTask(plugin, () -> player.openInventory(this.inventory)); } /** @@ -336,7 +322,7 @@ public class FastInv implements InventoryHolder { public void open(Player... players) { Bukkit.getScheduler().runTask(plugin, () -> { for (Player p : players) { - p.openInventory(inventory); + p.openInventory(this.inventory); } }); } @@ -345,8 +331,8 @@ public class FastInv implements InventoryHolder { * Cancel all tasks. */ public void cancelTasks() { - tasks.forEach(BukkitTask::cancel); - tasks.clear(); + this.tasks.forEach(BukkitTask::cancel); + this.tasks.clear(); } /** @@ -388,7 +374,7 @@ public class FastInv implements InventoryHolder { * @return This associated FastInv instance. */ public FastInv getInventory() { - return inventory; + return this.inventory; } /** @@ -397,7 +383,7 @@ public class FastInv implements InventoryHolder { * @return the player who clicked. */ public Player getPlayer() { - return player; + return this.player; } /** @@ -406,7 +392,7 @@ public class FastInv implements InventoryHolder { * @return Whether the event was cancelled. */ public boolean isCancelled() { - return cancelled; + return this.cancelled; } /** @@ -485,7 +471,7 @@ public class FastInv implements InventoryHolder { */ @Override public Inventory getInventory() { - return inventory; + return this.inventory; } private static Listener getListener() { @@ -549,7 +535,6 @@ public class FastInv implements InventoryHolder { * Set if the tasks will be cancel on menus close. * * @param cancelTasksOnClose Set if the tasks will be cancel - * * @return This FastInv instance, for chaining. */ public FastInv setCancelTasksOnClose(boolean cancelTasksOnClose) { @@ -560,7 +545,7 @@ public class FastInv implements InventoryHolder { public void reOpen(Player player) { player.closeInventory(); refresh(); - player.openInventory(inventory); + player.openInventory(this.inventory); } public void refresh() { diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/IconInv.java b/src/main/java/com/songoda/epicvouchers/libraries/inventory/IconInv.java index 7521172..9092a61 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/IconInv.java +++ b/src/main/java/com/songoda/epicvouchers/libraries/inventory/IconInv.java @@ -72,7 +72,6 @@ public class IconInv implements InventoryHolder { * * @param type The type of the menus. * @param title The title of the menus. - * * @throws IllegalStateException if FastInv is not init with FastInv.init(Plugin plugin) */ public IconInv(InventoryType type, String title) { @@ -86,9 +85,9 @@ public class IconInv implements InventoryHolder { runSync(() -> { if (type == InventoryType.CHEST && size > 0) { - inventory = Bukkit.createInventory(this, size, title); + this.inventory = Bukkit.createInventory(this, size, title); } else { - inventory = Bukkit.createInventory(this, type, title); + this.inventory = Bukkit.createInventory(this, type, title); } }); } @@ -109,12 +108,11 @@ public class IconInv implements InventoryHolder { * Add an {@link ItemStack} to the menus with a {@link IconClickListener} to handle clicks. * * @param icon The icon to add. - * * @return This FastInv instance, for chaining. */ public IconInv addIcon(Icon icon) { runSync(() -> { - int slot = inventory.firstEmpty(); + int slot = this.inventory.firstEmpty(); if (slot >= 0) { addIcon(slot, icon); } @@ -127,13 +125,12 @@ public class IconInv implements InventoryHolder { * * @param slot The slot of the item. * @param icon The icon to add. - * * @return This FastInv instance, for chaining. */ public IconInv addIcon(int slot, Icon icon) { runSync(() -> { - inventory.setItem(slot, icon.getItemStack()); - itemListeners.put(slot, icon); + this.inventory.setItem(slot, icon.getItemStack()); + this.itemListeners.put(slot, icon); }); return this; @@ -145,7 +142,6 @@ public class IconInv implements InventoryHolder { * @param slotFrom Starting slot to put the item in. * @param slotTo Ending slot to put the item in. * @param icon The icon to add. - * * @return This FastInv instance, for chaining. */ public IconInv addIcon(int slotFrom, int slotTo, Icon icon) { @@ -159,14 +155,13 @@ public class IconInv implements InventoryHolder { * Add an {@link ItemStack} to the menus on the edges. * * @param icon The icon to add. - * * @return This FastInv instance, for chaining. */ public IconInv edge(Icon icon) { - int height = inventory.getSize() / 9; + int height = this.inventory.getSize() / 9; addIcon(0, 9, icon); - addIcon(inventory.getSize() - 9, inventory.getSize() - 1, icon); + addIcon(this.inventory.getSize() - 9, this.inventory.getSize() - 1, icon); for (int i = 0; i < height; i++) { addIcon(i * 9, icon); @@ -181,7 +176,6 @@ public class IconInv implements InventoryHolder { * * @param slots The slots to place the item. * @param icon The icon to add. - * * @return This FastInv instance, for chaining. */ public IconInv addIcon(int[] slots, Icon icon) { @@ -193,8 +187,8 @@ public class IconInv implements InventoryHolder { public IconInv fill(Icon icon) { runSync(() -> { - for (int i = 0; i < inventory.getSize(); i++) { - if (inventory.getItem(i) == null) { + for (int i = 0; i < this.inventory.getSize(); i++) { + if (this.inventory.getItem(i) == null) { addIcon(i, icon); } } @@ -218,11 +212,10 @@ public class IconInv implements InventoryHolder { * Add a {@link IconInvCloseListener} to listen on menus close. * * @param listener The {@link IconInvCloseListener} to add. - * * @return This FastInv instance, for chaining. */ public IconInv onClose(IconInvCloseListener listener) { - closeListeners.add(listener); + this.closeListeners.add(listener); return this; } @@ -230,11 +223,10 @@ public class IconInv implements InventoryHolder { * Add a {@link IconClickListener} to listen on menus click. * * @param listener The {@link IconClickListener} to add. - * * @return This FastInv instance, for chaining. */ public IconInv onClick(IconClickListener listener) { - clickListeners.add(listener); + this.clickListeners.add(listener); return this; } @@ -243,7 +235,6 @@ public class IconInv implements InventoryHolder { * * @param period Delay between each run. * @param runnable The {@link Runnable} task to run. - * * @return This FastInv instance, for chaining. */ public IconInv onUpdate(long period, Runnable runnable) { @@ -256,11 +247,10 @@ public class IconInv implements InventoryHolder { * @param delay Ticks to wait before starting the task. * @param period Delay between each run. * @param runnable The {@link Runnable} task to run. - * * @return This FastInv instance, for chaining */ public IconInv onUpdate(long delay, long period, Runnable runnable) { - tasks.add(Bukkit.getScheduler().runTaskTimer(plugin, runnable, delay, period)); + this.tasks.add(Bukkit.getScheduler().runTaskTimer(plugin, runnable, delay, period)); return this; } @@ -270,7 +260,7 @@ public class IconInv implements InventoryHolder { * @param player The player to open the menu. */ public void open(Player player) { - Bukkit.getScheduler().runTask(plugin, () -> player.openInventory(inventory)); + Bukkit.getScheduler().runTask(plugin, () -> player.openInventory(this.inventory)); } /** @@ -281,7 +271,7 @@ public class IconInv implements InventoryHolder { public void open(Player... players) { Bukkit.getScheduler().runTask(plugin, () -> { for (Player p : players) { - p.openInventory(inventory); + p.openInventory(this.inventory); } }); } @@ -290,8 +280,8 @@ public class IconInv implements InventoryHolder { * Cancel all tasks. */ public void cancelTasks() { - tasks.forEach(BukkitTask::cancel); - tasks.clear(); + this.tasks.forEach(BukkitTask::cancel); + this.tasks.clear(); } /** @@ -311,7 +301,6 @@ public class IconInv implements InventoryHolder { * Set if the tasks will be cancel on menus close. * * @param cancelTasksOnClose Set if the tasks will be cancel - * * @return This FastInv instance, for chaining. */ public IconInv setCancelTasksOnClose(boolean cancelTasksOnClose) { @@ -327,7 +316,7 @@ public class IconInv implements InventoryHolder { void onClose(IconInvCloseEvent event); } - public static abstract class IconEvent { + public abstract static class IconEvent { private final Player player; private final IconInv inventory; private boolean cancelled; @@ -344,7 +333,7 @@ public class IconInv implements InventoryHolder { * @return This associated FastInv instance. */ public IconInv getInventory() { - return inventory; + return this.inventory; } /** @@ -353,7 +342,7 @@ public class IconInv implements InventoryHolder { * @return the player who clicked. */ public Player getPlayer() { - return player; + return this.player; } /** @@ -362,7 +351,7 @@ public class IconInv implements InventoryHolder { * @return Whether the event was cancelled. */ public boolean isCancelled() { - return cancelled; + return this.cancelled; } /** @@ -434,11 +423,11 @@ public class IconInv implements InventoryHolder { } public boolean getDefaultCancel() { - return cancelled; + return this.cancelled; } public IconInv setDefaultCancel(boolean value) { - cancelled = value; + this.cancelled = value; return this; } @@ -449,7 +438,7 @@ public class IconInv implements InventoryHolder { */ @Override public Inventory getInventory() { - return inventory; + return this.inventory; } private static Listener getListener() { diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/PlayersMenu.java b/src/main/java/com/songoda/epicvouchers/libraries/inventory/PlayersMenu.java index 813124c..5cf2445 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/PlayersMenu.java +++ b/src/main/java/com/songoda/epicvouchers/libraries/inventory/PlayersMenu.java @@ -41,16 +41,16 @@ public abstract class PlayersMenu extends FastInv { @Override public void refresh() { fill(null); - final int startIndex = page * (players.size() - 1); + final int startIndex = this.page * (this.players.size() - 1); - IntStream.rangeClosed(0, SLOTS).forEach(slot -> { + IntStream.rangeClosed(0, this.SLOTS).forEach(slot -> { int index = startIndex + slot; - if (index >= players.size()) { + if (index >= this.players.size()) { return; } - Player player = players.get(index); + Player player = this.players.get(index); ItemStack itemStack = CompatibleMaterial.PLAYER_HEAD.getItem(); @@ -64,42 +64,43 @@ public abstract class PlayersMenu extends FastInv { skullMeta.setDisplayName(YELLOW + player.getName()); itemStack.setItemMeta(skullMeta); - addItem(slot, itemStack, event -> playerConsumer.accept(event.getPlayer(), player)); + addItem(slot, itemStack, event -> this.playerConsumer.accept(event.getPlayer(), player)); }); - if (players.size() / SLOTS > page) { + if (this.players.size() / this.SLOTS > this.page) { addItem(26, new ItemBuilder(ARROW) .name(YELLOW + "Next") .lore(GRAY + "Click to go to the next page of players") .build(), event -> { - page++; + this.page++; refresh(); }); } else { addItem(26, null); } - if (page > 0) { + if (this.page > 0) { addItem(18, new ItemBuilder(ARROW) .name(YELLOW + "Previous") .lore(GRAY + "Click to go to the previous page of players") .build(), event -> { - page--; + this.page--; refresh(); }); } else { addItem(18, new ItemBuilder(BARRIER) .name(YELLOW + "Return") .lore(GRAY + "Return to the action menu") - .addGlow().build(), event -> new ActionMenu(instance, voucher).open(event.getPlayer())); + .addGlow().build(), event -> new ActionMenu(this.instance, this.voucher).open(event.getPlayer())); } - if (instance.getConfig().getBoolean("Interface.Fill Interfaces With Glass")) { + if (this.instance.getConfig().getBoolean("Interface.Fill Interfaces With Glass")) { ItemStack fillItem = CompatibleMaterial.GRAY_STAINED_GLASS_PANE.getItem(); - IntStream.rangeClosed(SLOTS + 1, 26).forEach(slot -> { - if (getInventory().getItem(slot) == null) + IntStream.rangeClosed(this.SLOTS + 1, 26).forEach(slot -> { + if (getInventory().getItem(slot) == null) { addItem(slot, new ItemBuilder(fillItem).name(ChatColor.RESET.toString()).build()); + } }); } } diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/Icon.java b/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/Icon.java index 669dedc..9b6f295 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/Icon.java +++ b/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/Icon.java @@ -9,8 +9,9 @@ public class Icon { private final ItemStack itemStack; private final Consumer consumer; - public Icon(ItemStack itemStack) { - this(itemStack, event -> { }); + public Icon(ItemStack item) { + this(item, event -> { + }); } public Icon(ItemStack item, Consumer consumer) { @@ -18,7 +19,11 @@ public class Icon { this.consumer = consumer; } - public void run(IconClickEvent e) { consumer.accept(e); } + public void run(IconClickEvent e) { + this.consumer.accept(e); + } - public ItemStack getItemStack() { return itemStack; } + public ItemStack getItemStack() { + return this.itemStack; + } } diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/StringIcon.java b/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/StringIcon.java index 38824bb..2f844e5 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/StringIcon.java +++ b/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/StringIcon.java @@ -38,12 +38,12 @@ public class StringIcon extends Icon { .lore(GRAY + "Current: " + WHITE + current, GRAY + "Right click to edit", GRAY + "Left click to clear").build(), current, consumer, predicate, noLeft); } - public StringIcon(EpicVouchers instance, ItemStack itemStack, String current, BiConsumer consumer) { - this(instance, itemStack, current, consumer, s -> true, false); + public StringIcon(EpicVouchers instance, ItemStack item, String current, BiConsumer consumer) { + this(instance, item, current, consumer, s -> true, false); } - public StringIcon(EpicVouchers instance, ItemStack itemStack, String current, BiConsumer consumer, Predicate predicate, boolean noLeft) { - super(itemStack, event -> { + public StringIcon(EpicVouchers instance, ItemStack item, String current, BiConsumer consumer, Predicate predicate, boolean noLeft) { + super(item, event -> { if (!noLeft && event.getClickType() == ClickType.LEFT) { consumer.accept(event.getPlayer(), ""); event.getPlayer().sendMessage(TextUtils.formatText("&7Successfully cleared&7.")); diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/ToggleableIcon.java b/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/ToggleableIcon.java index f87255f..6c96d25 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/ToggleableIcon.java +++ b/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/ToggleableIcon.java @@ -8,18 +8,19 @@ import org.bukkit.Material; import java.util.function.Consumer; public class ToggleableIcon extends Icon { - private Consumer consumer; + private final Consumer consumer; public ToggleableIcon(String displayname, Consumer consumer, boolean state) { super(new ItemBuilder(Material.PAPER) .name(ChatColor.YELLOW + displayname) .lore(state ? ChatColor.GREEN + "ENABLED" : ChatColor.RED + "DISABLED") - .build(), event -> { }); + .build(), event -> { + }); this.consumer = consumer; } @Override - public void run(IconClickEvent event) { - consumer.accept(event); + public void run(IconClickEvent e) { + this.consumer.accept(e); } } diff --git a/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java b/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java index 6fb8477..8742469 100644 --- a/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java +++ b/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java @@ -85,8 +85,8 @@ public class PlayerInteractListener implements Listener { /** * @deprecated This is a legacy method that is only used for backwards compatibility - * with vouchers that were created before the voucher key was stored in NBT. - * Some checks in here don't even look like they make sense or look redundant... Hard to touch this. + * with vouchers that were created before the voucher key was stored in NBT. + * Some checks in here don't even look like they make sense or look redundant... Hard to touch this. */ @Deprecated private Voucher findVoucherForLegacyItem(ItemStack item, Collection allVouchers) { diff --git a/src/main/java/com/songoda/epicvouchers/menus/VoucherEditorMenu.java b/src/main/java/com/songoda/epicvouchers/menus/VoucherEditorMenu.java index c76fe8c..c877a2f 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/VoucherEditorMenu.java +++ b/src/main/java/com/songoda/epicvouchers/menus/VoucherEditorMenu.java @@ -131,6 +131,6 @@ public class VoucherEditorMenu extends IconInv { } private void reopen(Player player) { - new VoucherEditorMenu(instance, voucher).open(player); + new VoucherEditorMenu(this.instance, this.voucher).open(player); } } diff --git a/src/main/java/com/songoda/epicvouchers/menus/VoucherMenu.java b/src/main/java/com/songoda/epicvouchers/menus/VoucherMenu.java index 540fd7c..5714fa3 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/VoucherMenu.java +++ b/src/main/java/com/songoda/epicvouchers/menus/VoucherMenu.java @@ -34,7 +34,7 @@ public class VoucherMenu extends IconInv { .lore(TextUtils.formatText("&eCreate a new voucher with set id.")).build(), event -> { AnvilGui gui = new AnvilGui(event.getPlayer()); gui.setTitle("Insert id"); - gui.setAction(aevent -> { + gui.setAction(aEvent -> { final String msg = gui.getInputText().trim(); if (instance.getVoucherManager().getVoucher(msg) != null) { event.getPlayer().sendMessage(TextUtils.formatText("&cAlready a voucher registered with the id: " + msg)); diff --git a/src/main/java/com/songoda/epicvouchers/menus/sub/editor/SoundsMenu.java b/src/main/java/com/songoda/epicvouchers/menus/sub/editor/SoundsMenu.java index 398d099..ec9db99 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/sub/editor/SoundsMenu.java +++ b/src/main/java/com/songoda/epicvouchers/menus/sub/editor/SoundsMenu.java @@ -32,6 +32,5 @@ public class SoundsMenu extends IconInv { .name(YELLOW + "Return") .lore(GRAY + "Return to the editor") .build(), event -> new VoucherEditorMenu(instance, voucher).open(event.getPlayer())); - } } diff --git a/src/main/java/com/songoda/epicvouchers/settings/Settings.java b/src/main/java/com/songoda/epicvouchers/settings/Settings.java index e0dd321..10e05ee 100644 --- a/src/main/java/com/songoda/epicvouchers/settings/Settings.java +++ b/src/main/java/com/songoda/epicvouchers/settings/Settings.java @@ -5,11 +5,8 @@ import com.songoda.core.configuration.ConfigSetting; import com.songoda.epicvouchers.EpicVouchers; import org.bukkit.event.Listener; -/** - * Created by songo on 6/4/2017. - */ public class Settings implements Listener { - static final Config config = EpicVouchers.getInstance().getCoreConfig(); + static final Config config = EpicVouchers.getPlugin(EpicVouchers.class).getCoreConfig(); public static final ConfigSetting FILL_GLASS = new ConfigSetting(config, "Interface.Fill Interfaces With Glass", true); public static final ConfigSetting COOLDOWN_DELAY = new ConfigSetting(config, "Main.Cooldown Delay", 10); diff --git a/src/main/java/com/songoda/epicvouchers/utils/CachedSet.java b/src/main/java/com/songoda/epicvouchers/utils/CachedSet.java index 005a450..849c8a2 100644 --- a/src/main/java/com/songoda/epicvouchers/utils/CachedSet.java +++ b/src/main/java/com/songoda/epicvouchers/utils/CachedSet.java @@ -25,16 +25,16 @@ public class CachedSet { clearStale(); } - return this.cache.computeIfPresent(obj, (k, aLong) -> System.currentTimeMillis()) != null; + return this.cache.computeIfPresent(obj, (key, aLong) -> System.currentTimeMillis()) != null; } public void clearStale() { - this.cache.entrySet().removeIf(entry -> System.currentTimeMillis() - entry.getValue() >= ttl); + this.cache.entrySet().removeIf(entry -> System.currentTimeMillis() - entry.getValue() >= this.ttl); this.lastClear = System.currentTimeMillis(); } private boolean shouldClear() { - return !this.cache.isEmpty() && System.currentTimeMillis() - lastClear > ttl; + return !this.cache.isEmpty() && System.currentTimeMillis() - this.lastClear > this.ttl; } } diff --git a/src/main/java/com/songoda/epicvouchers/utils/Pair.java b/src/main/java/com/songoda/epicvouchers/utils/Pair.java index e4a34bc..a729018 100644 --- a/src/main/java/com/songoda/epicvouchers/utils/Pair.java +++ b/src/main/java/com/songoda/epicvouchers/utils/Pair.java @@ -19,7 +19,9 @@ public class Pair implements Serializable { * * @return key for this pair */ - public String getKey() { return key; } + public String getKey() { + return this.key; + } /** * Value of this this Pair. @@ -31,7 +33,9 @@ public class Pair implements Serializable { * * @return value for this pair */ - public String getValue() { return value; } + public String getValue() { + return this.value; + } /** * Creates a new pair @@ -54,7 +58,7 @@ public class Pair implements Serializable { */ @Override public String toString() { - return key + "=" + value; + return this.key + "=" + this.value; } /** @@ -72,7 +76,7 @@ public class Pair implements Serializable { // these two parameters: // name: a value: aa // name: aa value: a - return key.hashCode() * 13 + (value == null ? 0 : value.hashCode()); + return this.key.hashCode() * 13 + (this.value == null ? 0 : this.value.hashCode()); } /** @@ -88,17 +92,19 @@ public class Pair implements Serializable { * * @param o the Object to test for * equality with this Pair - * * @return true if the given Object is - * equal to this Pair else false + * equal to this Pair else false */ @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } Pair pair = (Pair) o; - return Objects.equals(key, pair.key) && Objects.equals(value, pair.value); + return Objects.equals(this.key, pair.key) && Objects.equals(this.value, pair.value); } } - diff --git a/src/main/java/com/songoda/epicvouchers/utils/ThreadSync.java b/src/main/java/com/songoda/epicvouchers/utils/ThreadSync.java index 78b488a..4f49af9 100644 --- a/src/main/java/com/songoda/epicvouchers/utils/ThreadSync.java +++ b/src/main/java/com/songoda/epicvouchers/utils/ThreadSync.java @@ -8,10 +8,10 @@ public class ThreadSync { private final AtomicReference waiting = new AtomicReference<>(true); public void waitForRelease() { - synchronized (syncObj) { - while (waiting.get()) { + synchronized (this.syncObj) { + while (this.waiting.get()) { try { - syncObj.wait(); + this.syncObj.wait(); } catch (Exception ignore) { } } @@ -19,13 +19,13 @@ public class ThreadSync { } public void release() { - synchronized (syncObj) { - waiting.set(false); - syncObj.notifyAll(); + synchronized (this.syncObj) { + this.waiting.set(false); + this.syncObj.notifyAll(); } } public void reset() { - waiting.set(true); + this.waiting.set(true); } } diff --git a/src/main/java/com/songoda/epicvouchers/voucher/CoolDownManager.java b/src/main/java/com/songoda/epicvouchers/voucher/CoolDownManager.java index df4e3aa..aacc87a 100644 --- a/src/main/java/com/songoda/epicvouchers/voucher/CoolDownManager.java +++ b/src/main/java/com/songoda/epicvouchers/voucher/CoolDownManager.java @@ -21,14 +21,14 @@ public class CoolDownManager { } if (voucher.getCoolDown() != 0) { - entries.put(uuid, System.currentTimeMillis() + voucher.getCoolDown() * 1000L); + this.entries.put(uuid, System.currentTimeMillis() + voucher.getCoolDown() * 1000L); } else { - entries.put(uuid, System.currentTimeMillis() + instance.getConfig().getInt("Main.Cooldown Delay") * 1000L); + this.entries.put(uuid, System.currentTimeMillis() + this.instance.getConfig().getInt("Main.Cooldown Delay") * 1000L); } } public boolean isOnCoolDown(UUID uuid) { - Long time = entries.get(uuid); + Long time = this.entries.get(uuid); if (time == null) { return false; @@ -38,12 +38,12 @@ public class CoolDownManager { return true; } - entries.remove(uuid); + this.entries.remove(uuid); return false; } public long getTime(UUID uuid) { - Long time = entries.get(uuid); + Long time = this.entries.get(uuid); if (time == null) { return 0L; diff --git a/src/main/java/com/songoda/epicvouchers/voucher/Voucher.java b/src/main/java/com/songoda/epicvouchers/voucher/Voucher.java index 75ede49..f09fb3e 100644 --- a/src/main/java/com/songoda/epicvouchers/voucher/Voucher.java +++ b/src/main/java/com/songoda/epicvouchers/voucher/Voucher.java @@ -81,32 +81,32 @@ public class Voucher { } public ItemStack toItemStack(int amount) { - ItemStack item = itemStack == null ? new ItemStack(material, amount, data) : itemStack; + ItemStack item = this.itemStack == null ? new ItemStack(this.material, amount, this.data) : this.itemStack; ItemMeta meta = item.getItemMeta(); if (meta == null) { - meta = Bukkit.getItemFactory().getItemMeta(material); + meta = Bukkit.getItemFactory().getItemMeta(this.material); } - if (!name.isEmpty()) { - meta.setDisplayName(TextUtils.formatText(name)); + if (!this.name.isEmpty()) { + meta.setDisplayName(TextUtils.formatText(this.name)); } - if (lore != null) { + if (this.lore != null) { meta.setLore(getLore(true)); } - if (glow) { + if (this.glow) { meta.addEnchant(Enchantment.DURABILITY, 1, false); meta.addItemFlags(ItemFlag.HIDE_ENCHANTS); } - if (hideAttributes) { + if (this.hideAttributes) { meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE); } - if (unbreakable) { + if (this.unbreakable) { if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_9)) { meta.setUnbreakable(true); item.setItemMeta(meta); @@ -119,18 +119,18 @@ public class Voucher { } } - if (texture != null && !texture.isEmpty() && CompatibleMaterial.PLAYER_HEAD.getMaterial() == material) { - item = ItemUtils.getCustomHead(texture); + if (this.texture != null && !this.texture.isEmpty() && CompatibleMaterial.PLAYER_HEAD.getMaterial() == this.material) { + item = ItemUtils.getCustomHead(this.texture); } NBTItem nbtItem = new NBTItem(item); - nbtItem.setString("epicvouchers:voucher", key); + nbtItem.setString("epicvouchers:voucher", this.key); return nbtItem.getItem(); } public String getName(boolean applyFormatting) { - return applyFormatting ? TextUtils.formatText(name) : name; + return applyFormatting ? TextUtils.formatText(this.name) : this.name; } public List getLore(boolean applyFormatting) { @@ -172,23 +172,23 @@ public class Voucher { public void saveSetting(String key, List list) { switch (key) { case "Commands": - commands = list; + this.commands = list; break; case "Broadcasts": - broadcasts = list; + this.broadcasts = list; break; case "Messages": - messages = list; + this.messages = list; break; case "Lore": - lore = list; + this.lore = list; break; } } @Override public String toString() { - return key; + return this.key; } public void giveAll(CommandSender sender, int amount) { @@ -196,13 +196,13 @@ public class Voucher { } public void give(CommandSender sender, List players, int amount) { - String giveMessage = instance.getLocale().getMessage("command.give.send") + String giveMessage = this.instance.getLocale().getMessage("command.give.send") .processPlaceholder("player", players.size() == 1 ? players.get(0).getName() : "everyone") .processPlaceholder("voucher", getName(true)) .processPlaceholder("amount", String.valueOf(amount)).getPrefixedMessage(); for (Player player : players) { - String receiveMessage = instance.getLocale().getMessage("command.give.receive") + String receiveMessage = this.instance.getLocale().getMessage("command.give.receive") .processPlaceholder("voucher", getName(true)) .processPlaceholder("player", player.getName()) .processPlaceholder("amount", String.valueOf(amount)).getPrefixedMessage(); @@ -211,7 +211,7 @@ public class Voucher { Bukkit.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { - instance.getLocale().getMessage("command.give.cancelled").sendPrefixedMessage(sender); + this.instance.getLocale().getMessage("command.give.cancelled").sendPrefixedMessage(sender); continue; } @@ -232,7 +232,7 @@ public class Voucher { } for (int i = 0; i < amount; i++) { - instance.getVoucherExecutor().redeemVoucher(player, this, player.getItemInHand(), false, null); + this.instance.getVoucherExecutor().redeemVoucher(player, this, player.getItemInHand(), false, null); } } } @@ -241,45 +241,46 @@ public class Voucher { Player player = event.getPlayer(); // does the player have permission to redeem this voucher? - if (!permission.isEmpty() && !player.hasPermission(permission)) { - player.sendMessage(instance.getLocale().getMessage("event.general.nopermission").getPrefixedMessage()); + if (!this.permission.isEmpty() && !player.hasPermission(this.permission)) { + player.sendMessage(this.instance.getLocale().getMessage("event.general.nopermission").getPrefixedMessage()); return; } UUID uuid = player.getUniqueId(); - if (instance.getCoolDowns().isOnCoolDown(uuid)) { - instance.getLocale().getMessage("event.general.cooldown") - .processPlaceholder("time", instance.getCoolDowns().getTime(uuid)) + if (this.instance.getCoolDowns().isOnCoolDown(uuid)) { + this.instance.getLocale().getMessage("event.general.cooldown") + .processPlaceholder("time", this.instance.getCoolDowns().getTime(uuid)) .processPlaceholder("voucher", getName(true)) .sendPrefixedMessage(player); return; } - if (confirm) { - new ConfirmMenu(instance, - () -> instance.getVoucherExecutor().redeemVoucher(player, this, event.getItem(), true, event), - () -> { }) + if (this.confirm) { + new ConfirmMenu(this.instance, + () -> this.instance.getVoucherExecutor().redeemVoucher(player, this, event.getItem(), true, event), + () -> { + }) .open(player); } else { - instance.getVoucherExecutor().redeemVoucher(player, this, event.getItem(), true, event); + this.instance.getVoucherExecutor().redeemVoucher(player, this, event.getItem(), true, event); } } public String getTexture() { - return texture; + return this.texture; } public String getActionBar() { - return TextUtils.formatText(actionBar); + return TextUtils.formatText(this.actionBar); } public String getSubTitle() { - return TextUtils.formatText(subTitle); + return TextUtils.formatText(this.subTitle); } public String getTitle() { - return TextUtils.formatText(title); + return TextUtils.formatText(this.title); } public String getKey() { diff --git a/src/main/java/com/songoda/epicvouchers/voucher/VoucherExecutor.java b/src/main/java/com/songoda/epicvouchers/voucher/VoucherExecutor.java index a3d1778..1e91ba6 100644 --- a/src/main/java/com/songoda/epicvouchers/voucher/VoucherExecutor.java +++ b/src/main/java/com/songoda/epicvouchers/voucher/VoucherExecutor.java @@ -51,7 +51,7 @@ public class VoucherExecutor { if (!duplication) { if (manual) { - instance.getCoolDowns().addCoolDown(player.getUniqueId(), voucher); + this.instance.getCoolDowns().addCoolDown(player.getUniqueId(), voucher); if (voucher.isRemoveItem()) { if (item.getAmount() <= 1) { item = null; @@ -116,17 +116,14 @@ public class VoucherExecutor { String delayCommand = StringUtils.substringBetween(command, "[", "]"); int delay = Integer.parseInt(delayCommand.split("-", 2)[1]); final String finalCommand = command.replace("[" + delayCommand + "]", ""); - final ItemStack heldItem = item; - Bukkit.getScheduler().scheduleSyncDelayedTask(instance, () -> { - runCommand(finalCommand, player); - }, 20 * delay); + Bukkit.getScheduler().scheduleSyncDelayedTask(this.instance, () -> runCommand(finalCommand, player), 20L * delay); } else { Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), command); } } if (voucher.getActionBar() != null && !voucher.getActionBar().isEmpty()) { String actionbar = voucher.getActionBar().replaceAll("%player%", name).replaceAll("%voucher%", voucher.getName(true)); - instance.getLocale().newMessage(actionbar).sendActionBar(player); + this.instance.getLocale().newMessage(actionbar).sendActionBar(player); } if (voucher.getTitle() != null && !voucher.getTitle().isEmpty()) { @@ -166,14 +163,14 @@ public class VoucherExecutor { player.addPotionEffect(new PotionEffect(PotionEffectType.getByName(effect), duration, amplifier)); } - instance.getLogger().log(Level.INFO, player.getName() + " has successfully redeemed the voucher " + voucher.getKey() + "."); - instance.getConnections().saveRedeem(player, voucher.getName(true)); + this.instance.getLogger().log(Level.INFO, player.getName() + " has successfully redeemed the voucher " + voucher.getKey() + "."); + this.instance.getConnections().saveRedeem(player, voucher.getName(true)); } else { - instance.getLogger().log(Level.WARNING, player.getName() + " has failed to duplicate the voucher " + voucher.getKey() + "."); + this.instance.getLogger().log(Level.WARNING, player.getName() + " has failed to duplicate the voucher " + voucher.getKey() + "."); } } catch (Exception error) { - instance.getLogger().log(Level.SEVERE, "Failed to redeem the voucher " + voucher.getKey() + " for the player " + player.getName() + "."); - instance.getLogger().log(Level.SEVERE, error.getMessage()); + this.instance.getLogger().log(Level.SEVERE, "Failed to redeem the voucher " + voucher.getKey() + " for the player " + player.getName() + "."); + this.instance.getLogger().log(Level.SEVERE, error.getMessage()); error.printStackTrace(); } } diff --git a/src/main/java/com/songoda/epicvouchers/voucher/VoucherManager.java b/src/main/java/com/songoda/epicvouchers/voucher/VoucherManager.java index 9e2c5aa..5bf9c48 100644 --- a/src/main/java/com/songoda/epicvouchers/voucher/VoucherManager.java +++ b/src/main/java/com/songoda/epicvouchers/voucher/VoucherManager.java @@ -8,22 +8,22 @@ public class VoucherManager { private final Map registeredVouchers = new HashMap<>(); public Voucher addVoucher(Voucher voucher) { - return registeredVouchers.put(voucher.getKey(), voucher); + return this.registeredVouchers.put(voucher.getKey(), voucher); } public Voucher removeVoucher(Voucher voucher) { - return registeredVouchers.remove(voucher); + return this.registeredVouchers.remove(voucher); } public Voucher getVoucher(String key) { - return registeredVouchers.get(key); + return this.registeredVouchers.get(key); } public Collection getVouchers() { - return registeredVouchers.values(); + return this.registeredVouchers.values(); } public void clearVouchers() { - registeredVouchers.clear(); + this.registeredVouchers.clear(); } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 665b45e..a03be99 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -12,5 +12,5 @@ commands: epicvouchers: description: View information on this plugin. default: true - aliases: [ev] + aliases: [ ev ] usage: /ev From e0d19d701e501e69a8a4762bc987695eb7b48529 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Tue, 18 Jul 2023 15:04:21 +0200 Subject: [PATCH 05/13] Updates `.gitignore` and `.editorconfig` --- .editorconfig | 301 ++------------------------------------------------ .gitignore | 11 +- 2 files changed, 16 insertions(+), 296 deletions(-) diff --git a/.editorconfig b/.editorconfig index 9737e6f..e918259 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,6 @@ +root = true + + [*] charset = utf-8 end_of_line = lf @@ -10,302 +13,14 @@ trim_trailing_whitespace = true ij_continuation_indent_size = 8 ij_formatter_off_tag = @formatter:off ij_formatter_on_tag = @formatter:on -ij_formatter_tags_enabled = false -ij_smart_tabs = false -ij_visual_guides = none -ij_wrap_on_typing = false +ij_formatter_tags_enabled = true -[*.java] -ij_smart_tabs = true -ij_java_align_consecutive_assignments = false -ij_java_align_consecutive_variable_declarations = false -ij_java_align_group_field_declarations = false -ij_java_align_multiline_annotation_parameters = false -ij_java_align_multiline_array_initializer_expression = false -ij_java_align_multiline_assignment = false -ij_java_align_multiline_binary_operation = false -ij_java_align_multiline_chained_methods = false -ij_java_align_multiline_extends_list = false -ij_java_align_multiline_for = true -ij_java_align_multiline_method_parentheses = false -ij_java_align_multiline_parameters = true -ij_java_align_multiline_parameters_in_calls = false -ij_java_align_multiline_parenthesized_expression = false -ij_java_align_multiline_records = true -ij_java_align_multiline_resources = true -ij_java_align_multiline_ternary_operation = false -ij_java_align_multiline_text_blocks = false -ij_java_align_multiline_throws_list = false -ij_java_align_subsequent_simple_methods = false -ij_java_align_throws_keyword = false -ij_java_annotation_parameter_wrap = off -ij_java_array_initializer_new_line_after_left_brace = false -ij_java_array_initializer_right_brace_on_new_line = false -ij_java_array_initializer_wrap = off -ij_java_assert_statement_colon_on_next_line = false -ij_java_assert_statement_wrap = off -ij_java_assignment_wrap = off -ij_java_binary_operation_sign_on_next_line = false -ij_java_binary_operation_wrap = off -ij_java_blank_lines_after_anonymous_class_header = 0 -ij_java_blank_lines_after_class_header = 0 -ij_java_blank_lines_after_imports = 1 -ij_java_blank_lines_after_package = 1 -ij_java_blank_lines_around_class = 1 -ij_java_blank_lines_around_field = 0 -ij_java_blank_lines_around_field_in_interface = 0 -ij_java_blank_lines_around_initializer = 1 -ij_java_blank_lines_around_method = 1 -ij_java_blank_lines_around_method_in_interface = 1 -ij_java_blank_lines_before_class_end = 0 -ij_java_blank_lines_before_imports = 1 -ij_java_blank_lines_before_method_body = 0 -ij_java_blank_lines_before_package = 0 -ij_java_block_brace_style = end_of_line -ij_java_block_comment_at_first_column = true -ij_java_builder_methods = none -ij_java_call_parameters_new_line_after_left_paren = false -ij_java_call_parameters_right_paren_on_new_line = false -ij_java_call_parameters_wrap = off -ij_java_case_statement_on_separate_line = true -ij_java_catch_on_new_line = false -ij_java_class_annotation_wrap = split_into_lines -ij_java_class_brace_style = end_of_line -ij_java_class_count_to_use_import_on_demand = 15 -ij_java_class_names_in_javadoc = 1 -ij_java_do_not_indent_top_level_class_members = false -ij_java_do_not_wrap_after_single_annotation = false -ij_java_do_while_brace_force = never -ij_java_doc_add_blank_line_after_description = true -ij_java_doc_add_blank_line_after_param_comments = true -ij_java_doc_add_blank_line_after_return = true -ij_java_doc_add_p_tag_on_empty_lines = true -ij_java_doc_align_exception_comments = true -ij_java_doc_align_param_comments = true -ij_java_doc_do_not_wrap_if_one_line = true -ij_java_doc_enable_formatting = true -ij_java_doc_enable_leading_asterisks = true -ij_java_doc_indent_on_continuation = true -ij_java_doc_keep_empty_lines = true -ij_java_doc_keep_empty_parameter_tag = true -ij_java_doc_keep_empty_return_tag = true -ij_java_doc_keep_empty_throws_tag = true -ij_java_doc_keep_invalid_tags = true -ij_java_doc_param_description_on_new_line = false -ij_java_doc_preserve_line_breaks = false -ij_java_doc_use_throws_not_exception_tag = true -ij_java_else_on_new_line = false -ij_java_enum_constants_wrap = off -ij_java_extends_keyword_wrap = off -ij_java_extends_list_wrap = off -ij_java_field_annotation_wrap = split_into_lines -ij_java_finally_on_new_line = false -ij_java_for_brace_force = never -ij_java_for_statement_new_line_after_left_paren = false -ij_java_for_statement_right_paren_on_new_line = false -ij_java_for_statement_wrap = off -ij_java_generate_final_locals = false -ij_java_generate_final_parameters = false -ij_java_if_brace_force = never -ij_java_imports_layout = *, |, javax.**, java.**, |, $* -ij_java_indent_case_from_switch = true -ij_java_insert_inner_class_imports = false -ij_java_insert_override_annotation = true -ij_java_keep_blank_lines_before_right_brace = 0 -ij_java_keep_blank_lines_between_package_declaration_and_header = 0 -ij_java_keep_blank_lines_in_code = 1 -ij_java_keep_blank_lines_in_declarations = 1 -ij_java_keep_builder_methods_indents = false -ij_java_keep_control_statement_in_one_line = true -ij_java_keep_first_column_comment = true -ij_java_keep_indents_on_empty_lines = false -ij_java_keep_line_breaks = true -ij_java_keep_multiple_expressions_in_one_line = false -ij_java_keep_simple_blocks_in_one_line = false -ij_java_keep_simple_classes_in_one_line = true -ij_java_keep_simple_lambdas_in_one_line = true -ij_java_keep_simple_methods_in_one_line = true -ij_java_label_indent_absolute = false -ij_java_label_indent_size = 0 -ij_java_lambda_brace_style = end_of_line -ij_java_layout_static_imports_separately = true -ij_java_line_comment_add_space = false -ij_java_line_comment_at_first_column = true -ij_java_method_annotation_wrap = split_into_lines -ij_java_method_brace_style = end_of_line -ij_java_method_call_chain_wrap = off -ij_java_method_parameters_new_line_after_left_paren = false -ij_java_method_parameters_right_paren_on_new_line = false -ij_java_method_parameters_wrap = off -ij_java_modifier_list_wrap = false -ij_java_names_count_to_use_import_on_demand = 9 -ij_java_new_line_after_lparen_in_record_header = false -ij_java_packages_to_use_import_on_demand = _java.awt.*, _javax.swing.* -ij_java_parameter_annotation_wrap = off -ij_java_parentheses_expression_new_line_after_left_paren = false -ij_java_parentheses_expression_right_paren_on_new_line = false -ij_java_place_assignment_sign_on_next_line = false -ij_java_prefer_longer_names = true -ij_java_prefer_parameters_wrap = false -ij_java_record_components_wrap = normal -ij_java_repeat_synchronized = true -ij_java_replace_instanceof_and_cast = true -ij_java_replace_null_check = true -ij_java_replace_sum_lambda_with_method_ref = true -ij_java_resource_list_new_line_after_left_paren = false -ij_java_resource_list_right_paren_on_new_line = false -ij_java_resource_list_wrap = off -ij_java_rparen_on_new_line_in_record_header = false -ij_java_space_after_closing_angle_bracket_in_type_argument = false -ij_java_space_after_colon = true -ij_java_space_after_comma = true -ij_java_space_after_comma_in_type_arguments = true -ij_java_space_after_for_semicolon = true -ij_java_space_after_quest = true -ij_java_space_after_type_cast = true -ij_java_space_before_annotation_array_initializer_left_brace = false -ij_java_space_before_annotation_parameter_list = false -ij_java_space_before_array_initializer_left_brace = true -ij_java_space_before_catch_keyword = true -ij_java_space_before_catch_left_brace = true -ij_java_space_before_catch_parentheses = true -ij_java_space_before_class_left_brace = true -ij_java_space_before_colon = true -ij_java_space_before_colon_in_foreach = true -ij_java_space_before_comma = false -ij_java_space_before_do_left_brace = true -ij_java_space_before_else_keyword = true -ij_java_space_before_else_left_brace = true -ij_java_space_before_finally_keyword = true -ij_java_space_before_finally_left_brace = true -ij_java_space_before_for_left_brace = true -ij_java_space_before_for_parentheses = true -ij_java_space_before_for_semicolon = false -ij_java_space_before_if_left_brace = true -ij_java_space_before_if_parentheses = true -ij_java_space_before_method_call_parentheses = false -ij_java_space_before_method_left_brace = true -ij_java_space_before_method_parentheses = false -ij_java_space_before_opening_angle_bracket_in_type_parameter = false -ij_java_space_before_quest = true -ij_java_space_before_switch_left_brace = true -ij_java_space_before_switch_parentheses = true -ij_java_space_before_synchronized_left_brace = true -ij_java_space_before_synchronized_parentheses = true -ij_java_space_before_try_left_brace = true -ij_java_space_before_try_parentheses = true -ij_java_space_before_type_parameter_list = false -ij_java_space_before_while_keyword = true -ij_java_space_before_while_left_brace = true -ij_java_space_before_while_parentheses = true -ij_java_space_inside_one_line_enum_braces = false -ij_java_space_within_empty_array_initializer_braces = true -ij_java_space_within_empty_method_call_parentheses = false -ij_java_space_within_empty_method_parentheses = false -ij_java_spaces_around_additive_operators = true -ij_java_spaces_around_assignment_operators = true -ij_java_spaces_around_bitwise_operators = true -ij_java_spaces_around_equality_operators = true -ij_java_spaces_around_lambda_arrow = true -ij_java_spaces_around_logical_operators = true -ij_java_spaces_around_method_ref_dbl_colon = false -ij_java_spaces_around_multiplicative_operators = true -ij_java_spaces_around_relational_operators = true -ij_java_spaces_around_shift_operators = true -ij_java_spaces_around_type_bounds_in_type_parameters = true -ij_java_spaces_around_unary_operator = false -ij_java_spaces_within_angle_brackets = false -ij_java_spaces_within_annotation_parentheses = false -ij_java_spaces_within_array_initializer_braces = false -ij_java_spaces_within_braces = true -ij_java_spaces_within_brackets = false -ij_java_spaces_within_cast_parentheses = false -ij_java_spaces_within_catch_parentheses = false -ij_java_spaces_within_for_parentheses = false -ij_java_spaces_within_if_parentheses = false -ij_java_spaces_within_method_call_parentheses = false -ij_java_spaces_within_method_parentheses = false -ij_java_spaces_within_parentheses = false -ij_java_spaces_within_record_header = false -ij_java_spaces_within_switch_parentheses = false -ij_java_spaces_within_synchronized_parentheses = false -ij_java_spaces_within_try_parentheses = false -ij_java_spaces_within_while_parentheses = false -ij_java_special_else_if_treatment = true -ij_java_subclass_name_suffix = Impl -ij_java_ternary_operation_signs_on_next_line = false -ij_java_ternary_operation_wrap = off -ij_java_test_name_suffix = Test -ij_java_throws_keyword_wrap = off -ij_java_throws_list_wrap = off -ij_java_use_external_annotations = false -ij_java_use_fq_class_names = false -ij_java_use_relative_indents = false -ij_java_use_single_class_imports = true -ij_java_variable_annotation_wrap = off -ij_java_visibility = public -ij_java_while_brace_force = never -ij_java_while_on_new_line = false -ij_java_wrap_comments = false -ij_java_wrap_first_method_in_call_chain = false -ij_java_wrap_long_lines = false -[*.properties] -ij_properties_align_group_field_declarations = false -ij_properties_keep_blank_lines = false -ij_properties_key_value_delimiter = equals -ij_properties_spaces_around_key_value_delimiter = false - -[.editorconfig] -ij_editorconfig_align_group_field_declarations = false -ij_editorconfig_space_after_colon = false -ij_editorconfig_space_after_comma = true -ij_editorconfig_space_before_colon = false -ij_editorconfig_space_before_comma = false -ij_editorconfig_spaces_around_assignment_operators = true - -[{*.ant, *.fxml, *.jhm, *.jnlp, *.jrxml, *.pom, *.rng, *.tld, *.wsdl, *.xml, *.xsd, *.xsl, *.xslt, *.xul}] -ij_xml_align_attributes = true -ij_xml_align_text = false -ij_xml_attribute_wrap = normal -ij_xml_block_comment_at_first_column = true -ij_xml_keep_blank_lines = 2 -ij_xml_keep_indents_on_empty_lines = false -ij_xml_keep_line_breaks = true -ij_xml_keep_line_breaks_in_text = true -ij_xml_keep_whitespaces = false -ij_xml_keep_whitespaces_around_cdata = preserve -ij_xml_keep_whitespaces_inside_cdata = false -ij_xml_line_comment_at_first_column = true -ij_xml_space_after_tag_name = false -ij_xml_space_around_equals_in_attribute = false -ij_xml_space_inside_empty_tag = false -ij_xml_text_wrap = normal - -[{*.markdown, *.md}] +[{*.yaml,*.yml,*.json,*.lang,*.graphqlconfig,*.har,*.jsb2,*.jsb3,*.webmanifest,.babelrc,.eslintrc,.prettierrc,.stylelintrc,bowerrc,jest.config}] indent_size = 2 tab_width = 2 -ij_markdown_force_one_space_after_blockquote_symbol = true -ij_markdown_force_one_space_after_header_symbol = true -ij_markdown_force_one_space_after_list_bullet = true -ij_markdown_force_one_space_between_words = true -ij_markdown_keep_indents_on_empty_lines = false -ij_markdown_max_lines_around_block_elements = 1 -ij_markdown_max_lines_around_header = 1 -ij_markdown_max_lines_between_paragraphs = 1 -ij_markdown_min_lines_around_block_elements = 1 -ij_markdown_min_lines_around_header = 1 -ij_markdown_min_lines_between_paragraphs = 1 -[{*.yaml, *.yml, *.lang}] + +[{*.markdown,*.md,*.html,*.htm,*.ng,*.sht,*.shtm,*.shtml,*.ts,*.ats,*.js,*.cjs,*.bash,*.sh,*.zsh}] indent_size = 2 -ij_yaml_align_values_properties = do_not_align -ij_yaml_autoinsert_sequence_marker = true -ij_yaml_block_mapping_on_new_line = false -ij_yaml_indent_sequence_value = true -ij_yaml_keep_indents_on_empty_lines = false -ij_yaml_keep_line_breaks = true -ij_yaml_sequence_on_new_line = false -ij_yaml_space_before_colon = false -ij_yaml_spaces_within_braces = true -ij_yaml_spaces_within_brackets = true +tab_width = 2 diff --git a/.gitignore b/.gitignore index 600a1f2..28d2db2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,10 @@ -/target/ - -# JetBrains IDEs +## JetBrains IDEs /.idea/ *.iml + +## Maven +/**/target/ +dependency-reduced-pom.xml + +## Misc. +.DS_Store From 91be66c2025cd14e2218a99b78c450a1f5a793a3 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Tue, 18 Jul 2023 15:04:33 +0200 Subject: [PATCH 06/13] Updates `.github/FUNDING.yml` --- .github/FUNDING.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index c4daa16..1ef9dcf 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,12 +1 @@ -# These are supported funding model platforms - -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: songoda -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] +custom: [ 'https://craftaro.to/+' ] From 6b930d3e25ea8d29c2cc14220441e882604ee443 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Tue, 18 Jul 2023 15:14:31 +0200 Subject: [PATCH 07/13] Migrate from SongodaCore to CraftaroCore v3.0.0-SNAPSHOT --- pom.xml | 27 +++++++++++-------- .../songoda/epicvouchers/EpicVouchers.java | 14 +++++----- .../epicvouchers/commands/CommandEditor.java | 2 +- .../commands/CommandEpicVouchers.java | 2 +- .../epicvouchers/commands/CommandForce.java | 2 +- .../commands/CommandForceAll.java | 2 +- .../epicvouchers/commands/CommandGive.java | 2 +- .../epicvouchers/commands/CommandGiveAll.java | 2 +- .../epicvouchers/commands/CommandList.java | 2 +- .../epicvouchers/commands/CommandReload.java | 2 +- .../epicvouchers/handlers/Connections.java | 2 +- .../libraries/inventory/PlayersMenu.java | 21 ++++++--------- .../inventory/icons/ListEntryIcon.java | 2 +- .../libraries/inventory/icons/StringIcon.java | 6 ++--- .../listeners/PlayerInteractListener.java | 2 +- .../epicvouchers/menus/ActionMenu.java | 6 ++--- .../epicvouchers/menus/ConfirmMenu.java | 4 +-- .../epicvouchers/menus/OptionMenu.java | 6 ++--- .../epicvouchers/menus/VoucherEditorMenu.java | 6 ++--- .../epicvouchers/menus/VoucherMenu.java | 6 ++--- .../menus/sub/editor/SetItemMenu.java | 4 +-- .../menus/sub/editor/StringListMenu.java | 4 +-- .../epicvouchers/settings/Settings.java | 4 +-- .../songoda/epicvouchers/voucher/Voucher.java | 12 ++++----- .../epicvouchers/voucher/VoucherExecutor.java | 4 +-- 25 files changed, 73 insertions(+), 73 deletions(-) diff --git a/pom.xml b/pom.xml index 4700244..a3393d3 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ - com.songoda:SongodaCore + com.craftaroSongodaCore @@ -71,7 +71,7 @@ - com.songoda.core + com.craftaro.core ${project.groupId}.epicvouchers.core @@ -98,12 +98,24 @@ - songoda-public - https://repo.songoda.com/repository/public/ + craftaro-minecraft-plugins + https://repo.craftaro.com/repository/minecraft-plugins/ + + + + SpigotMC + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + com.craftaro + CraftaroCore + 3.0.0-SNAPSHOT + compile + + org.spigotmc spigot-api @@ -111,13 +123,6 @@ provided - - com.songoda - SongodaCore - 2.6.21 - compile - - org.projectlombok lombok diff --git a/src/main/java/com/songoda/epicvouchers/EpicVouchers.java b/src/main/java/com/songoda/epicvouchers/EpicVouchers.java index 698cfff..94127c5 100644 --- a/src/main/java/com/songoda/epicvouchers/EpicVouchers.java +++ b/src/main/java/com/songoda/epicvouchers/EpicVouchers.java @@ -1,11 +1,11 @@ package com.songoda.epicvouchers; -import com.songoda.core.SongodaCore; -import com.songoda.core.SongodaPlugin; -import com.songoda.core.commands.CommandManager; -import com.songoda.core.compatibility.CompatibleMaterial; -import com.songoda.core.configuration.Config; -import com.songoda.core.gui.GuiManager; +import com.craftaro.core.SongodaCore; +import com.craftaro.core.SongodaPlugin; +import com.craftaro.core.commands.CommandManager; +import com.craftaro.core.configuration.Config; +import com.craftaro.core.gui.GuiManager; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.songoda.epicvouchers.commands.CommandEditor; import com.songoda.epicvouchers.commands.CommandEpicVouchers; import com.songoda.epicvouchers.commands.CommandForce; @@ -67,7 +67,7 @@ public class EpicVouchers extends SongodaPlugin { @Override public void onPluginEnable() { // Run Songoda Updater - SongodaCore.registerPlugin(this, 25, CompatibleMaterial.EMERALD); + SongodaCore.registerPlugin(this, 25, XMaterial.EMERALD); // Setup Config Settings.setupConfig(); diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandEditor.java b/src/main/java/com/songoda/epicvouchers/commands/CommandEditor.java index 64e81d0..4b07750 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandEditor.java +++ b/src/main/java/com/songoda/epicvouchers/commands/CommandEditor.java @@ -1,6 +1,6 @@ package com.songoda.epicvouchers.commands; -import com.songoda.core.commands.AbstractCommand; +import com.craftaro.core.commands.AbstractCommand; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.menus.VoucherMenu; import org.bukkit.command.CommandSender; diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandEpicVouchers.java b/src/main/java/com/songoda/epicvouchers/commands/CommandEpicVouchers.java index 2672e77..b35fb1a 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandEpicVouchers.java +++ b/src/main/java/com/songoda/epicvouchers/commands/CommandEpicVouchers.java @@ -1,6 +1,6 @@ package com.songoda.epicvouchers.commands; -import com.songoda.core.commands.AbstractCommand; +import com.craftaro.core.commands.AbstractCommand; import com.songoda.epicvouchers.EpicVouchers; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandForce.java b/src/main/java/com/songoda/epicvouchers/commands/CommandForce.java index 89dd9e0..64eee4f 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandForce.java +++ b/src/main/java/com/songoda/epicvouchers/commands/CommandForce.java @@ -1,6 +1,6 @@ package com.songoda.epicvouchers.commands; -import com.songoda.core.commands.AbstractCommand; +import com.craftaro.core.commands.AbstractCommand; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.voucher.Voucher; import org.bukkit.Bukkit; diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandForceAll.java b/src/main/java/com/songoda/epicvouchers/commands/CommandForceAll.java index 564fe44..9d9a977 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandForceAll.java +++ b/src/main/java/com/songoda/epicvouchers/commands/CommandForceAll.java @@ -1,6 +1,6 @@ package com.songoda.epicvouchers.commands; -import com.songoda.core.commands.AbstractCommand; +import com.craftaro.core.commands.AbstractCommand; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.voucher.Voucher; import org.bukkit.Bukkit; diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandGive.java b/src/main/java/com/songoda/epicvouchers/commands/CommandGive.java index c0bae2e..f276cd4 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandGive.java +++ b/src/main/java/com/songoda/epicvouchers/commands/CommandGive.java @@ -1,6 +1,6 @@ package com.songoda.epicvouchers.commands; -import com.songoda.core.commands.AbstractCommand; +import com.craftaro.core.commands.AbstractCommand; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.voucher.Voucher; import org.bukkit.Bukkit; diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandGiveAll.java b/src/main/java/com/songoda/epicvouchers/commands/CommandGiveAll.java index a876146..d0dec42 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandGiveAll.java +++ b/src/main/java/com/songoda/epicvouchers/commands/CommandGiveAll.java @@ -1,6 +1,6 @@ package com.songoda.epicvouchers.commands; -import com.songoda.core.commands.AbstractCommand; +import com.craftaro.core.commands.AbstractCommand; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.voucher.Voucher; import org.bukkit.command.CommandSender; diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandList.java b/src/main/java/com/songoda/epicvouchers/commands/CommandList.java index d53a307..3b44106 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandList.java +++ b/src/main/java/com/songoda/epicvouchers/commands/CommandList.java @@ -1,6 +1,6 @@ package com.songoda.epicvouchers.commands; -import com.songoda.core.commands.AbstractCommand; +import com.craftaro.core.commands.AbstractCommand; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.voucher.Voucher; import org.bukkit.command.CommandSender; diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandReload.java b/src/main/java/com/songoda/epicvouchers/commands/CommandReload.java index c304790..68d4730 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandReload.java +++ b/src/main/java/com/songoda/epicvouchers/commands/CommandReload.java @@ -1,6 +1,6 @@ package com.songoda.epicvouchers.commands; -import com.songoda.core.commands.AbstractCommand; +import com.craftaro.core.commands.AbstractCommand; import com.songoda.epicvouchers.EpicVouchers; import org.bukkit.command.CommandSender; diff --git a/src/main/java/com/songoda/epicvouchers/handlers/Connections.java b/src/main/java/com/songoda/epicvouchers/handlers/Connections.java index be43d64..e7197af 100644 --- a/src/main/java/com/songoda/epicvouchers/handlers/Connections.java +++ b/src/main/java/com/songoda/epicvouchers/handlers/Connections.java @@ -1,6 +1,6 @@ package com.songoda.epicvouchers.handlers; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.utils.TextUtils; import com.songoda.epicvouchers.EpicVouchers; import org.bukkit.entity.Player; diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/PlayersMenu.java b/src/main/java/com/songoda/epicvouchers/libraries/inventory/PlayersMenu.java index 5cf2445..16e765c 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/PlayersMenu.java +++ b/src/main/java/com/songoda/epicvouchers/libraries/inventory/PlayersMenu.java @@ -1,6 +1,7 @@ package com.songoda.epicvouchers.libraries.inventory; -import com.songoda.core.compatibility.CompatibleMaterial; +import com.craftaro.core.third_party.com.cryptomorin.xseries.SkullUtils; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.libraries.ItemBuilder; import com.songoda.epicvouchers.menus.ActionMenu; @@ -9,7 +10,7 @@ import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.SkullMeta; +import org.bukkit.inventory.meta.ItemMeta; import java.util.List; import java.util.function.BiConsumer; @@ -52,17 +53,11 @@ public abstract class PlayersMenu extends FastInv { Player player = this.players.get(index); - ItemStack itemStack = CompatibleMaterial.PLAYER_HEAD.getItem(); + ItemStack itemStack = SkullUtils.getSkull(player.getUniqueId()); - SkullMeta skullMeta = (SkullMeta) itemStack.getItemMeta(); - - try { - skullMeta.setOwningPlayer(player); - } catch (Throwable ignore) { - } - - skullMeta.setDisplayName(YELLOW + player.getName()); - itemStack.setItemMeta(skullMeta); + ItemMeta itemMeta = itemStack.getItemMeta(); + itemMeta.setDisplayName(YELLOW + player.getName()); + itemStack.setItemMeta(itemMeta); addItem(slot, itemStack, event -> this.playerConsumer.accept(event.getPlayer(), player)); }); @@ -95,7 +90,7 @@ public abstract class PlayersMenu extends FastInv { } if (this.instance.getConfig().getBoolean("Interface.Fill Interfaces With Glass")) { - ItemStack fillItem = CompatibleMaterial.GRAY_STAINED_GLASS_PANE.getItem(); + ItemStack fillItem = XMaterial.GRAY_STAINED_GLASS_PANE.parseItem(); IntStream.rangeClosed(this.SLOTS + 1, 26).forEach(slot -> { if (getInventory().getItem(slot) == null) { diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/ListEntryIcon.java b/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/ListEntryIcon.java index be3a692..5670ea3 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/ListEntryIcon.java +++ b/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/ListEntryIcon.java @@ -1,6 +1,6 @@ package com.songoda.epicvouchers.libraries.inventory.icons; -import com.songoda.core.input.ChatPrompt; +import com.craftaro.core.input.ChatPrompt; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.libraries.ItemBuilder; import com.songoda.epicvouchers.utils.Pair; diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/StringIcon.java b/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/StringIcon.java index 2f844e5..eda89ff 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/StringIcon.java +++ b/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/StringIcon.java @@ -1,8 +1,8 @@ package com.songoda.epicvouchers.libraries.inventory.icons; -import com.songoda.core.compatibility.ServerVersion; -import com.songoda.core.input.ChatPrompt; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.compatibility.ServerVersion; +import com.craftaro.core.input.ChatPrompt; +import com.craftaro.core.utils.TextUtils; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.libraries.ItemBuilder; import org.bukkit.Bukkit; diff --git a/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java b/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java index 8742469..2e9e0fa 100644 --- a/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java +++ b/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java @@ -1,6 +1,6 @@ package com.songoda.epicvouchers.listeners; -import com.songoda.core.third_party.de.tr7zw.nbtapi.NBTItem; +import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.settings.Settings; import com.songoda.epicvouchers.utils.CachedSet; diff --git a/src/main/java/com/songoda/epicvouchers/menus/ActionMenu.java b/src/main/java/com/songoda/epicvouchers/menus/ActionMenu.java index 0cf96be..1d9a803 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/ActionMenu.java +++ b/src/main/java/com/songoda/epicvouchers/menus/ActionMenu.java @@ -1,7 +1,7 @@ package com.songoda.epicvouchers.menus; -import com.songoda.core.compatibility.CompatibleMaterial; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.core.utils.TextUtils; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.libraries.ItemBuilder; import com.songoda.epicvouchers.libraries.inventory.FastInv; @@ -61,7 +61,7 @@ public class ActionMenu extends FastInv { .addGlow().build(), event -> new VoucherMenu(instance).open(event.getPlayer())); if (instance.getConfig().getBoolean("Interface.Fill Interfaces With Glass")) { - ItemStack fillItem = CompatibleMaterial.GRAY_STAINED_GLASS_PANE.getItem(); + ItemStack fillItem = XMaterial.GRAY_STAINED_GLASS_PANE.parseItem(); fill(new ItemBuilder(fillItem).name(ChatColor.RESET.toString()).build()); } diff --git a/src/main/java/com/songoda/epicvouchers/menus/ConfirmMenu.java b/src/main/java/com/songoda/epicvouchers/menus/ConfirmMenu.java index b573c49..e1a72cf 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/ConfirmMenu.java +++ b/src/main/java/com/songoda/epicvouchers/menus/ConfirmMenu.java @@ -1,6 +1,6 @@ package com.songoda.epicvouchers.menus; -import com.songoda.core.compatibility.CompatibleMaterial; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.libraries.ItemBuilder; import com.songoda.epicvouchers.libraries.inventory.FastInv; @@ -34,7 +34,7 @@ public class ConfirmMenu extends FastInv { }); if (instance.getConfig().getBoolean("Interface.Fill Interfaces With Glass")) { - ItemStack fillItem = CompatibleMaterial.GRAY_STAINED_GLASS_PANE.getItem(); + ItemStack fillItem = XMaterial.GRAY_STAINED_GLASS_PANE.parseItem(); fill(new ItemBuilder(fillItem).name(ChatColor.RESET.toString()).build()); } diff --git a/src/main/java/com/songoda/epicvouchers/menus/OptionMenu.java b/src/main/java/com/songoda/epicvouchers/menus/OptionMenu.java index cd70d07..c300653 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/OptionMenu.java +++ b/src/main/java/com/songoda/epicvouchers/menus/OptionMenu.java @@ -1,7 +1,7 @@ package com.songoda.epicvouchers.menus; -import com.songoda.core.compatibility.CompatibleMaterial; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.core.utils.TextUtils; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.libraries.ItemBuilder; import com.songoda.epicvouchers.libraries.inventory.FastInv; @@ -43,6 +43,6 @@ public class OptionMenu extends FastInv { .lore(TextUtils.formatText("&eSet the options of your voucher.")) .build(), event -> new VoucherEditorMenu(instance, voucher).open(event.getPlayer())); - fill(new ItemBuilder(CompatibleMaterial.GRAY_STAINED_GLASS_PANE.getItem()).name(ChatColor.RESET.toString()).build()); + fill(new ItemBuilder(XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial()).name(ChatColor.RESET.toString()).build()); } } diff --git a/src/main/java/com/songoda/epicvouchers/menus/VoucherEditorMenu.java b/src/main/java/com/songoda/epicvouchers/menus/VoucherEditorMenu.java index c877a2f..0fa70fb 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/VoucherEditorMenu.java +++ b/src/main/java/com/songoda/epicvouchers/menus/VoucherEditorMenu.java @@ -1,7 +1,7 @@ package com.songoda.epicvouchers.menus; -import com.songoda.core.compatibility.CompatibleMaterial; -import com.songoda.core.utils.ItemUtils; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.core.utils.ItemUtils; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.libraries.ItemBuilder; import com.songoda.epicvouchers.libraries.inventory.IconInv; @@ -89,7 +89,7 @@ public class VoucherEditorMenu extends IconInv { reopen(player); })); - addIcon(13, new StringIcon(instance, new ItemBuilder(voucher.getTexture() == null ? CompatibleMaterial.PLAYER_HEAD.getItem() : ItemUtils.getCustomHead(voucher.getTexture())) + addIcon(13, new StringIcon(instance, new ItemBuilder(voucher.getTexture() == null ? XMaterial.PLAYER_HEAD.parseItem() : ItemUtils.getCustomHead(voucher.getTexture())) .name(YELLOW + "Skull Texture") .lore(GRAY + "Right click to edit", GRAY + "Left click to clear").build(), voucher.getTexture(), (player, editString) -> { voucher.setTexture(editString); diff --git a/src/main/java/com/songoda/epicvouchers/menus/VoucherMenu.java b/src/main/java/com/songoda/epicvouchers/menus/VoucherMenu.java index 5714fa3..9e5c4b1 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/VoucherMenu.java +++ b/src/main/java/com/songoda/epicvouchers/menus/VoucherMenu.java @@ -1,8 +1,8 @@ package com.songoda.epicvouchers.menus; -import com.songoda.core.compatibility.ServerVersion; -import com.songoda.core.gui.AnvilGui; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.compatibility.ServerVersion; +import com.craftaro.core.gui.AnvilGui; +import com.craftaro.core.utils.TextUtils; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.libraries.ItemBuilder; import com.songoda.epicvouchers.libraries.inventory.IconInv; diff --git a/src/main/java/com/songoda/epicvouchers/menus/sub/editor/SetItemMenu.java b/src/main/java/com/songoda/epicvouchers/menus/sub/editor/SetItemMenu.java index 265b6db..7f7df33 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/sub/editor/SetItemMenu.java +++ b/src/main/java/com/songoda/epicvouchers/menus/sub/editor/SetItemMenu.java @@ -1,6 +1,6 @@ package com.songoda.epicvouchers.menus.sub.editor; -import com.songoda.core.compatibility.CompatibleMaterial; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.libraries.ItemBuilder; import com.songoda.epicvouchers.libraries.inventory.FastInv; @@ -20,7 +20,7 @@ public class SetItemMenu extends FastInv { setDefaultCancel(false); - fill(new ItemBuilder(CompatibleMaterial.GRAY_STAINED_GLASS_PANE.getItem()) + fill(new ItemBuilder(XMaterial.GRAY_STAINED_GLASS_PANE.parseItem()) .name(ChatColor.RESET.toString()).build(), event -> event.setCancelled(true)); addItem(13, null); diff --git a/src/main/java/com/songoda/epicvouchers/menus/sub/editor/StringListMenu.java b/src/main/java/com/songoda/epicvouchers/menus/sub/editor/StringListMenu.java index f54f4e1..3098a23 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/sub/editor/StringListMenu.java +++ b/src/main/java/com/songoda/epicvouchers/menus/sub/editor/StringListMenu.java @@ -1,7 +1,7 @@ package com.songoda.epicvouchers.menus.sub.editor; -import com.songoda.core.input.ChatPrompt; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.input.ChatPrompt; +import com.craftaro.core.utils.TextUtils; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.libraries.ItemBuilder; import com.songoda.epicvouchers.libraries.inventory.IconInv; diff --git a/src/main/java/com/songoda/epicvouchers/settings/Settings.java b/src/main/java/com/songoda/epicvouchers/settings/Settings.java index 10e05ee..dafd736 100644 --- a/src/main/java/com/songoda/epicvouchers/settings/Settings.java +++ b/src/main/java/com/songoda/epicvouchers/settings/Settings.java @@ -1,7 +1,7 @@ package com.songoda.epicvouchers.settings; -import com.songoda.core.configuration.Config; -import com.songoda.core.configuration.ConfigSetting; +import com.craftaro.core.configuration.Config; +import com.craftaro.core.configuration.ConfigSetting; import com.songoda.epicvouchers.EpicVouchers; import org.bukkit.event.Listener; diff --git a/src/main/java/com/songoda/epicvouchers/voucher/Voucher.java b/src/main/java/com/songoda/epicvouchers/voucher/Voucher.java index f09fb3e..53248d9 100644 --- a/src/main/java/com/songoda/epicvouchers/voucher/Voucher.java +++ b/src/main/java/com/songoda/epicvouchers/voucher/Voucher.java @@ -1,10 +1,10 @@ package com.songoda.epicvouchers.voucher; -import com.songoda.core.compatibility.CompatibleMaterial; -import com.songoda.core.compatibility.ServerVersion; -import com.songoda.core.third_party.de.tr7zw.nbtapi.NBTItem; -import com.songoda.core.utils.ItemUtils; -import com.songoda.core.utils.TextUtils; +import com.craftaro.core.compatibility.ServerVersion; +import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem; +import com.craftaro.core.utils.ItemUtils; +import com.craftaro.core.utils.TextUtils; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.events.ForceRedeemEvent; import com.songoda.epicvouchers.events.VoucherReceiveEvent; @@ -119,7 +119,7 @@ public class Voucher { } } - if (this.texture != null && !this.texture.isEmpty() && CompatibleMaterial.PLAYER_HEAD.getMaterial() == this.material) { + if (this.texture != null && !this.texture.isEmpty() && XMaterial.PLAYER_HEAD.parseMaterial() == this.material) { item = ItemUtils.getCustomHead(this.texture); } diff --git a/src/main/java/com/songoda/epicvouchers/voucher/VoucherExecutor.java b/src/main/java/com/songoda/epicvouchers/voucher/VoucherExecutor.java index 1e91ba6..43b23b1 100644 --- a/src/main/java/com/songoda/epicvouchers/voucher/VoucherExecutor.java +++ b/src/main/java/com/songoda/epicvouchers/voucher/VoucherExecutor.java @@ -1,7 +1,7 @@ package com.songoda.epicvouchers.voucher; -import com.songoda.core.compatibility.CompatibleSound; -import com.songoda.core.compatibility.ServerVersion; +import com.craftaro.core.compatibility.CompatibleSound; +import com.craftaro.core.compatibility.ServerVersion; import com.songoda.epicvouchers.EpicVouchers; import com.songoda.epicvouchers.events.VoucherRedeemEvent; import com.songoda.epicvouchers.listeners.PlayerCommandListener; From bdf5caec997009e3545f85facd04833567cf4a70 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Tue, 18 Jul 2023 15:23:51 +0200 Subject: [PATCH 08/13] Modernize and clean up `pom.xml` and `plugin.yml` --- pom.xml | 69 ++++++++++++----------------------- src/main/resources/plugin.yml | 6 +-- 2 files changed, 25 insertions(+), 50 deletions(-) diff --git a/pom.xml b/pom.xml index a3393d3..2a5976a 100644 --- a/pom.xml +++ b/pom.xml @@ -9,72 +9,56 @@ 2.2.6 EpicVouchers - Enhance your server with awesome customizable vouchers with a lot of features. - https://songoda.com/marketplace/product/25 + Create vouchers that players can claim for rewards with seemingly infinite possibilities + https://craftaro.com/marketplace/product/25 - 1.8 - 8 + 8 + 1.8 + 1.8 UTF-8 - clean install - EpicVouchers-${project.version} - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - - ${java.version} - ${java.version} - - - org.apache.maven.plugins maven-shade-plugin - 3.3.0-SNAPSHOT + 3.5.0 - shaded package shade + ${project.name}-${project.version} + false - false - - - - com.craftaroSongodaCore - - - - - - *:* - - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - - - + true + true com.craftaro.core - ${project.groupId}.epicvouchers.core + com.songoda.epicvouchers.core + + + + *:* + + + META-INF/** + LICENSE + LICENSE.** + + + @@ -89,13 +73,6 @@ - - - apache.snapshots - https://repository.apache.org/snapshots/ - - - craftaro-minecraft-plugins diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index a03be99..982742c 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -5,12 +5,10 @@ api-version: 1.13 main: com.songoda.epicvouchers.EpicVouchers -author: Songoda +author: Craftaro website: ${project.url} commands: - epicvouchers: - description: View information on this plugin. + EpicVouchers: default: true aliases: [ ev ] - usage: /ev From b85930355378373b6a6caa45a693bf72fb47c84f Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Tue, 18 Jul 2023 15:34:16 +0200 Subject: [PATCH 09/13] Move classes from package `com.songoda` to `com.craftaro` --- pom.xml | 6 +-- .../epicvouchers/EpicVouchers.java | 42 +++++++++---------- .../epicvouchers/commands/CommandEditor.java | 6 +-- .../commands/CommandEpicVouchers.java | 6 +-- .../epicvouchers/commands/CommandForce.java | 6 +-- .../commands/CommandForceAll.java | 6 +-- .../epicvouchers/commands/CommandGive.java | 6 +-- .../epicvouchers/commands/CommandGiveAll.java | 6 +-- .../epicvouchers/commands/CommandList.java | 6 +-- .../epicvouchers/commands/CommandReload.java | 4 +- .../epicvouchers/events/ForceRedeemEvent.java | 2 +- .../events/VoucherReceiveEvent.java | 2 +- .../events/VoucherRedeemEvent.java | 2 +- .../epicvouchers/handlers/Connections.java | 4 +- .../epicvouchers/libraries/ItemBuilder.java | 2 +- .../libraries/inventory/FastInv.java | 2 +- .../libraries/inventory/IconInv.java | 4 +- .../libraries/inventory/PlayersMenu.java | 10 ++--- .../libraries/inventory/icons/Icon.java | 10 ++--- .../inventory/icons/IntegerIcon.java | 4 +- .../inventory/icons/ListEntryIcon.java | 8 ++-- .../libraries/inventory/icons/StringIcon.java | 6 +-- .../inventory/icons/StringListIcon.java | 10 ++--- .../inventory/icons/ToggleableIcon.java | 12 +++--- .../listeners/PlayerCommandListener.java | 2 +- .../listeners/PlayerInteractListener.java | 10 ++--- .../epicvouchers/menus/ActionMenu.java | 14 +++---- .../epicvouchers/menus/ConfirmMenu.java | 8 ++-- .../epicvouchers/menus/OptionMenu.java | 12 +++--- .../epicvouchers/menus/VoucherEditorMenu.java | 26 ++++++------ .../epicvouchers/menus/VoucherMenu.java | 12 +++--- .../menus/sub/action/ForceMenu.java | 8 ++-- .../menus/sub/action/GiveMenu.java | 8 ++-- .../menus/sub/editor/EffectsMenu.java | 16 +++---- .../menus/sub/editor/ParticlesMenu.java | 16 +++---- .../menus/sub/editor/SetItemMenu.java | 12 +++--- .../menus/sub/editor/SoundsMenu.java | 16 +++---- .../menus/sub/editor/StringListMenu.java | 14 +++---- .../menus/sub/editor/TitlesMenu.java | 16 +++---- .../epicvouchers/settings/Settings.java | 4 +- .../epicvouchers/utils/CachedSet.java | 2 +- .../epicvouchers/utils/Callback.java | 2 +- .../epicvouchers/utils/Pair.java | 2 +- .../epicvouchers/utils/ThreadSync.java | 2 +- .../epicvouchers/voucher/CoolDownManager.java | 4 +- .../epicvouchers/voucher/Voucher.java | 10 ++--- .../epicvouchers/voucher/VoucherExecutor.java | 8 ++-- .../epicvouchers/voucher/VoucherManager.java | 2 +- src/main/resources/plugin.yml | 2 +- src/main/resources/vouchers.yml | 2 +- 50 files changed, 201 insertions(+), 201 deletions(-) rename src/main/java/com/{songoda => craftaro}/epicvouchers/EpicVouchers.java (91%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/commands/CommandEditor.java (87%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/commands/CommandEpicVouchers.java (89%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/commands/CommandForce.java (94%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/commands/CommandForceAll.java (93%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/commands/CommandGive.java (94%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/commands/CommandGiveAll.java (92%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/commands/CommandList.java (89%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/commands/CommandReload.java (92%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/events/ForceRedeemEvent.java (96%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/events/VoucherReceiveEvent.java (97%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/events/VoucherRedeemEvent.java (96%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/handlers/Connections.java (97%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/libraries/ItemBuilder.java (99%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/libraries/inventory/FastInv.java (99%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/libraries/inventory/IconInv.java (99%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/libraries/inventory/PlayersMenu.java (93%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/libraries/inventory/icons/Icon.java (57%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/libraries/inventory/icons/IntegerIcon.java (82%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/libraries/inventory/icons/ListEntryIcon.java (84%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/libraries/inventory/icons/StringIcon.java (95%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/libraries/inventory/icons/StringListIcon.java (64%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/libraries/inventory/icons/ToggleableIcon.java (54%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/listeners/PlayerCommandListener.java (94%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/listeners/PlayerInteractListener.java (93%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/menus/ActionMenu.java (88%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/menus/ConfirmMenu.java (89%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/menus/OptionMenu.java (85%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/menus/VoucherEditorMenu.java (88%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/menus/VoucherMenu.java (89%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/menus/sub/action/ForceMenu.java (63%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/menus/sub/action/GiveMenu.java (62%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/menus/sub/editor/EffectsMenu.java (71%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/menus/sub/editor/ParticlesMenu.java (67%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/menus/sub/editor/SetItemMenu.java (88%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/menus/sub/editor/SoundsMenu.java (69%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/menus/sub/editor/StringListMenu.java (85%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/menus/sub/editor/TitlesMenu.java (77%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/settings/Settings.java (95%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/utils/CachedSet.java (96%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/utils/Callback.java (76%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/utils/Pair.java (98%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/utils/ThreadSync.java (94%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/voucher/CoolDownManager.java (93%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/voucher/Voucher.java (98%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/voucher/VoucherExecutor.java (97%) rename src/main/java/com/{songoda => craftaro}/epicvouchers/voucher/VoucherManager.java (94%) diff --git a/pom.xml b/pom.xml index 2a5976a..710eac1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,8 +4,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.songoda - EpicVouchers + com.craftaro + EpicVouchers-Plugin 2.2.6 EpicVouchers @@ -44,7 +44,7 @@ com.craftaro.core - com.songoda.epicvouchers.core + com.craftaro.epicvouchers.core diff --git a/src/main/java/com/songoda/epicvouchers/EpicVouchers.java b/src/main/java/com/craftaro/epicvouchers/EpicVouchers.java similarity index 91% rename from src/main/java/com/songoda/epicvouchers/EpicVouchers.java rename to src/main/java/com/craftaro/epicvouchers/EpicVouchers.java index 94127c5..ec089df 100644 --- a/src/main/java/com/songoda/epicvouchers/EpicVouchers.java +++ b/src/main/java/com/craftaro/epicvouchers/EpicVouchers.java @@ -1,4 +1,4 @@ -package com.songoda.epicvouchers; +package com.craftaro.epicvouchers; import com.craftaro.core.SongodaCore; import com.craftaro.core.SongodaPlugin; @@ -6,26 +6,26 @@ import com.craftaro.core.commands.CommandManager; import com.craftaro.core.configuration.Config; import com.craftaro.core.gui.GuiManager; import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; -import com.songoda.epicvouchers.commands.CommandEditor; -import com.songoda.epicvouchers.commands.CommandEpicVouchers; -import com.songoda.epicvouchers.commands.CommandForce; -import com.songoda.epicvouchers.commands.CommandForceAll; -import com.songoda.epicvouchers.commands.CommandGive; -import com.songoda.epicvouchers.commands.CommandGiveAll; -import com.songoda.epicvouchers.commands.CommandList; -import com.songoda.epicvouchers.commands.CommandReload; -import com.songoda.epicvouchers.handlers.Connections; -import com.songoda.epicvouchers.libraries.inventory.FastInv; -import com.songoda.epicvouchers.libraries.inventory.IconInv; -import com.songoda.epicvouchers.listeners.PlayerCommandListener; -import com.songoda.epicvouchers.listeners.PlayerInteractListener; -import com.songoda.epicvouchers.settings.Settings; -import com.songoda.epicvouchers.utils.Callback; -import com.songoda.epicvouchers.utils.ThreadSync; -import com.songoda.epicvouchers.voucher.CoolDownManager; -import com.songoda.epicvouchers.voucher.Voucher; -import com.songoda.epicvouchers.voucher.VoucherExecutor; -import com.songoda.epicvouchers.voucher.VoucherManager; +import com.craftaro.epicvouchers.commands.CommandEditor; +import com.craftaro.epicvouchers.commands.CommandEpicVouchers; +import com.craftaro.epicvouchers.commands.CommandForce; +import com.craftaro.epicvouchers.commands.CommandForceAll; +import com.craftaro.epicvouchers.commands.CommandGive; +import com.craftaro.epicvouchers.commands.CommandGiveAll; +import com.craftaro.epicvouchers.commands.CommandList; +import com.craftaro.epicvouchers.commands.CommandReload; +import com.craftaro.epicvouchers.handlers.Connections; +import com.craftaro.epicvouchers.libraries.inventory.FastInv; +import com.craftaro.epicvouchers.libraries.inventory.IconInv; +import com.craftaro.epicvouchers.listeners.PlayerCommandListener; +import com.craftaro.epicvouchers.listeners.PlayerInteractListener; +import com.craftaro.epicvouchers.settings.Settings; +import com.craftaro.epicvouchers.utils.Callback; +import com.craftaro.epicvouchers.utils.ThreadSync; +import com.craftaro.epicvouchers.voucher.CoolDownManager; +import com.craftaro.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.voucher.VoucherExecutor; +import com.craftaro.epicvouchers.voucher.VoucherManager; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandEditor.java b/src/main/java/com/craftaro/epicvouchers/commands/CommandEditor.java similarity index 87% rename from src/main/java/com/songoda/epicvouchers/commands/CommandEditor.java rename to src/main/java/com/craftaro/epicvouchers/commands/CommandEditor.java index 4b07750..26d63ec 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandEditor.java +++ b/src/main/java/com/craftaro/epicvouchers/commands/CommandEditor.java @@ -1,8 +1,8 @@ -package com.songoda.epicvouchers.commands; +package com.craftaro.epicvouchers.commands; import com.craftaro.core.commands.AbstractCommand; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.menus.VoucherMenu; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.menus.VoucherMenu; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandEpicVouchers.java b/src/main/java/com/craftaro/epicvouchers/commands/CommandEpicVouchers.java similarity index 89% rename from src/main/java/com/songoda/epicvouchers/commands/CommandEpicVouchers.java rename to src/main/java/com/craftaro/epicvouchers/commands/CommandEpicVouchers.java index b35fb1a..140d8c5 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandEpicVouchers.java +++ b/src/main/java/com/craftaro/epicvouchers/commands/CommandEpicVouchers.java @@ -1,7 +1,7 @@ -package com.songoda.epicvouchers.commands; +package com.craftaro.epicvouchers.commands; import com.craftaro.core.commands.AbstractCommand; -import com.songoda.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.EpicVouchers; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; @@ -19,7 +19,7 @@ public class CommandEpicVouchers extends AbstractCommand { protected ReturnType runCommand(CommandSender sender, String... args) { sender.sendMessage(""); this.instance.getLocale().newMessage("&7Version " + this.instance.getDescription().getVersion() - + " Created with <3 by &5&l&oSongoda").sendPrefixedMessage(sender); + + " Created with <3 by &5&l&oCraftaro").sendPrefixedMessage(sender); for (AbstractCommand command : this.instance.getCommandManager().getAllCommands()) { if (command.getPermissionNode() == null || sender.hasPermission(command.getPermissionNode())) { diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandForce.java b/src/main/java/com/craftaro/epicvouchers/commands/CommandForce.java similarity index 94% rename from src/main/java/com/songoda/epicvouchers/commands/CommandForce.java rename to src/main/java/com/craftaro/epicvouchers/commands/CommandForce.java index 64eee4f..57d3d5f 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandForce.java +++ b/src/main/java/com/craftaro/epicvouchers/commands/CommandForce.java @@ -1,8 +1,8 @@ -package com.songoda.epicvouchers.commands; +package com.craftaro.epicvouchers.commands; import com.craftaro.core.commands.AbstractCommand; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.voucher.Voucher; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandForceAll.java b/src/main/java/com/craftaro/epicvouchers/commands/CommandForceAll.java similarity index 93% rename from src/main/java/com/songoda/epicvouchers/commands/CommandForceAll.java rename to src/main/java/com/craftaro/epicvouchers/commands/CommandForceAll.java index 9d9a977..22e355a 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandForceAll.java +++ b/src/main/java/com/craftaro/epicvouchers/commands/CommandForceAll.java @@ -1,8 +1,8 @@ -package com.songoda.epicvouchers.commands; +package com.craftaro.epicvouchers.commands; import com.craftaro.core.commands.AbstractCommand; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.voucher.Voucher; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandGive.java b/src/main/java/com/craftaro/epicvouchers/commands/CommandGive.java similarity index 94% rename from src/main/java/com/songoda/epicvouchers/commands/CommandGive.java rename to src/main/java/com/craftaro/epicvouchers/commands/CommandGive.java index f276cd4..7bcac4b 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandGive.java +++ b/src/main/java/com/craftaro/epicvouchers/commands/CommandGive.java @@ -1,8 +1,8 @@ -package com.songoda.epicvouchers.commands; +package com.craftaro.epicvouchers.commands; import com.craftaro.core.commands.AbstractCommand; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.voucher.Voucher; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandGiveAll.java b/src/main/java/com/craftaro/epicvouchers/commands/CommandGiveAll.java similarity index 92% rename from src/main/java/com/songoda/epicvouchers/commands/CommandGiveAll.java rename to src/main/java/com/craftaro/epicvouchers/commands/CommandGiveAll.java index d0dec42..75c5403 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandGiveAll.java +++ b/src/main/java/com/craftaro/epicvouchers/commands/CommandGiveAll.java @@ -1,8 +1,8 @@ -package com.songoda.epicvouchers.commands; +package com.craftaro.epicvouchers.commands; import com.craftaro.core.commands.AbstractCommand; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.voucher.Voucher; import org.bukkit.command.CommandSender; import java.util.ArrayList; diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandList.java b/src/main/java/com/craftaro/epicvouchers/commands/CommandList.java similarity index 89% rename from src/main/java/com/songoda/epicvouchers/commands/CommandList.java rename to src/main/java/com/craftaro/epicvouchers/commands/CommandList.java index 3b44106..d579818 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandList.java +++ b/src/main/java/com/craftaro/epicvouchers/commands/CommandList.java @@ -1,8 +1,8 @@ -package com.songoda.epicvouchers.commands; +package com.craftaro.epicvouchers.commands; import com.craftaro.core.commands.AbstractCommand; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.voucher.Voucher; import org.bukkit.command.CommandSender; import java.util.List; diff --git a/src/main/java/com/songoda/epicvouchers/commands/CommandReload.java b/src/main/java/com/craftaro/epicvouchers/commands/CommandReload.java similarity index 92% rename from src/main/java/com/songoda/epicvouchers/commands/CommandReload.java rename to src/main/java/com/craftaro/epicvouchers/commands/CommandReload.java index 68d4730..836eea3 100644 --- a/src/main/java/com/songoda/epicvouchers/commands/CommandReload.java +++ b/src/main/java/com/craftaro/epicvouchers/commands/CommandReload.java @@ -1,7 +1,7 @@ -package com.songoda.epicvouchers.commands; +package com.craftaro.epicvouchers.commands; import com.craftaro.core.commands.AbstractCommand; -import com.songoda.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.EpicVouchers; import org.bukkit.command.CommandSender; import java.util.List; diff --git a/src/main/java/com/songoda/epicvouchers/events/ForceRedeemEvent.java b/src/main/java/com/craftaro/epicvouchers/events/ForceRedeemEvent.java similarity index 96% rename from src/main/java/com/songoda/epicvouchers/events/ForceRedeemEvent.java rename to src/main/java/com/craftaro/epicvouchers/events/ForceRedeemEvent.java index 468d510..f051b38 100644 --- a/src/main/java/com/songoda/epicvouchers/events/ForceRedeemEvent.java +++ b/src/main/java/com/craftaro/epicvouchers/events/ForceRedeemEvent.java @@ -1,4 +1,4 @@ -package com.songoda.epicvouchers.events; +package com.craftaro.epicvouchers.events; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/com/songoda/epicvouchers/events/VoucherReceiveEvent.java b/src/main/java/com/craftaro/epicvouchers/events/VoucherReceiveEvent.java similarity index 97% rename from src/main/java/com/songoda/epicvouchers/events/VoucherReceiveEvent.java rename to src/main/java/com/craftaro/epicvouchers/events/VoucherReceiveEvent.java index a93638c..f141c9e 100644 --- a/src/main/java/com/songoda/epicvouchers/events/VoucherReceiveEvent.java +++ b/src/main/java/com/craftaro/epicvouchers/events/VoucherReceiveEvent.java @@ -1,4 +1,4 @@ -package com.songoda.epicvouchers.events; +package com.craftaro.epicvouchers.events; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/com/songoda/epicvouchers/events/VoucherRedeemEvent.java b/src/main/java/com/craftaro/epicvouchers/events/VoucherRedeemEvent.java similarity index 96% rename from src/main/java/com/songoda/epicvouchers/events/VoucherRedeemEvent.java rename to src/main/java/com/craftaro/epicvouchers/events/VoucherRedeemEvent.java index fb846d7..2f278a9 100644 --- a/src/main/java/com/songoda/epicvouchers/events/VoucherRedeemEvent.java +++ b/src/main/java/com/craftaro/epicvouchers/events/VoucherRedeemEvent.java @@ -1,4 +1,4 @@ -package com.songoda.epicvouchers.events; +package com.craftaro.epicvouchers.events; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; diff --git a/src/main/java/com/songoda/epicvouchers/handlers/Connections.java b/src/main/java/com/craftaro/epicvouchers/handlers/Connections.java similarity index 97% rename from src/main/java/com/songoda/epicvouchers/handlers/Connections.java rename to src/main/java/com/craftaro/epicvouchers/handlers/Connections.java index e7197af..733779a 100644 --- a/src/main/java/com/songoda/epicvouchers/handlers/Connections.java +++ b/src/main/java/com/craftaro/epicvouchers/handlers/Connections.java @@ -1,7 +1,7 @@ -package com.songoda.epicvouchers.handlers; +package com.craftaro.epicvouchers.handlers; import com.craftaro.core.utils.TextUtils; -import com.songoda.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.EpicVouchers; import org.bukkit.entity.Player; import java.sql.Connection; diff --git a/src/main/java/com/songoda/epicvouchers/libraries/ItemBuilder.java b/src/main/java/com/craftaro/epicvouchers/libraries/ItemBuilder.java similarity index 99% rename from src/main/java/com/songoda/epicvouchers/libraries/ItemBuilder.java rename to src/main/java/com/craftaro/epicvouchers/libraries/ItemBuilder.java index a533f2a..f07b36e 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/ItemBuilder.java +++ b/src/main/java/com/craftaro/epicvouchers/libraries/ItemBuilder.java @@ -1,4 +1,4 @@ -package com.songoda.epicvouchers.libraries; +package com.craftaro.epicvouchers.libraries; import org.bukkit.Color; import org.bukkit.DyeColor; diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/FastInv.java b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/FastInv.java similarity index 99% rename from src/main/java/com/songoda/epicvouchers/libraries/inventory/FastInv.java rename to src/main/java/com/craftaro/epicvouchers/libraries/inventory/FastInv.java index 09e8999..4481cbe 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/FastInv.java +++ b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/FastInv.java @@ -1,4 +1,4 @@ -package com.songoda.epicvouchers.libraries.inventory; +package com.craftaro.epicvouchers.libraries.inventory; import org.bukkit.Bukkit; import org.bukkit.entity.Player; diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/IconInv.java b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/IconInv.java similarity index 99% rename from src/main/java/com/songoda/epicvouchers/libraries/inventory/IconInv.java rename to src/main/java/com/craftaro/epicvouchers/libraries/inventory/IconInv.java index 9092a61..774a101 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/IconInv.java +++ b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/IconInv.java @@ -1,6 +1,6 @@ -package com.songoda.epicvouchers.libraries.inventory; +package com.craftaro.epicvouchers.libraries.inventory; -import com.songoda.epicvouchers.libraries.inventory.icons.Icon; +import com.craftaro.epicvouchers.libraries.inventory.icons.Icon; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/PlayersMenu.java b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/PlayersMenu.java similarity index 93% rename from src/main/java/com/songoda/epicvouchers/libraries/inventory/PlayersMenu.java rename to src/main/java/com/craftaro/epicvouchers/libraries/inventory/PlayersMenu.java index 16e765c..4906910 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/PlayersMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/PlayersMenu.java @@ -1,11 +1,11 @@ -package com.songoda.epicvouchers.libraries.inventory; +package com.craftaro.epicvouchers.libraries.inventory; import com.craftaro.core.third_party.com.cryptomorin.xseries.SkullUtils; import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.libraries.ItemBuilder; -import com.songoda.epicvouchers.menus.ActionMenu; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.libraries.ItemBuilder; +import com.craftaro.epicvouchers.menus.ActionMenu; +import com.craftaro.epicvouchers.voucher.Voucher; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/Icon.java b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/icons/Icon.java similarity index 57% rename from src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/Icon.java rename to src/main/java/com/craftaro/epicvouchers/libraries/inventory/icons/Icon.java index 9b6f295..1f442cf 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/Icon.java +++ b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/icons/Icon.java @@ -1,25 +1,25 @@ -package com.songoda.epicvouchers.libraries.inventory.icons; +package com.craftaro.epicvouchers.libraries.inventory.icons; -import com.songoda.epicvouchers.libraries.inventory.IconInv.IconClickEvent; +import com.craftaro.epicvouchers.libraries.inventory.IconInv; import org.bukkit.inventory.ItemStack; import java.util.function.Consumer; public class Icon { private final ItemStack itemStack; - private final Consumer consumer; + private final Consumer consumer; public Icon(ItemStack item) { this(item, event -> { }); } - public Icon(ItemStack item, Consumer consumer) { + public Icon(ItemStack item, Consumer consumer) { this.itemStack = item; this.consumer = consumer; } - public void run(IconClickEvent e) { + public void run(IconInv.IconClickEvent e) { this.consumer.accept(e); } diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/IntegerIcon.java b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/icons/IntegerIcon.java similarity index 82% rename from src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/IntegerIcon.java rename to src/main/java/com/craftaro/epicvouchers/libraries/inventory/icons/IntegerIcon.java index 839033f..71907f3 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/IntegerIcon.java +++ b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/icons/IntegerIcon.java @@ -1,6 +1,6 @@ -package com.songoda.epicvouchers.libraries.inventory.icons; +package com.craftaro.epicvouchers.libraries.inventory.icons; -import com.songoda.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.EpicVouchers; import org.apache.commons.lang.StringUtils; import org.bukkit.Material; import org.bukkit.entity.Player; diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/ListEntryIcon.java b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/icons/ListEntryIcon.java similarity index 84% rename from src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/ListEntryIcon.java rename to src/main/java/com/craftaro/epicvouchers/libraries/inventory/icons/ListEntryIcon.java index 5670ea3..16395ae 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/ListEntryIcon.java +++ b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/icons/ListEntryIcon.java @@ -1,9 +1,9 @@ -package com.songoda.epicvouchers.libraries.inventory.icons; +package com.craftaro.epicvouchers.libraries.inventory.icons; import com.craftaro.core.input.ChatPrompt; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.libraries.ItemBuilder; -import com.songoda.epicvouchers.utils.Pair; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.libraries.ItemBuilder; +import com.craftaro.epicvouchers.utils.Pair; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/StringIcon.java b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/icons/StringIcon.java similarity index 95% rename from src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/StringIcon.java rename to src/main/java/com/craftaro/epicvouchers/libraries/inventory/icons/StringIcon.java index eda89ff..7a27f2c 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/StringIcon.java +++ b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/icons/StringIcon.java @@ -1,10 +1,10 @@ -package com.songoda.epicvouchers.libraries.inventory.icons; +package com.craftaro.epicvouchers.libraries.inventory.icons; import com.craftaro.core.compatibility.ServerVersion; import com.craftaro.core.input.ChatPrompt; import com.craftaro.core.utils.TextUtils; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.libraries.ItemBuilder; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.libraries.ItemBuilder; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/StringListIcon.java b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/icons/StringListIcon.java similarity index 64% rename from src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/StringListIcon.java rename to src/main/java/com/craftaro/epicvouchers/libraries/inventory/icons/StringListIcon.java index 67eaa92..cf963f2 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/StringListIcon.java +++ b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/icons/StringListIcon.java @@ -1,9 +1,9 @@ -package com.songoda.epicvouchers.libraries.inventory.icons; +package com.craftaro.epicvouchers.libraries.inventory.icons; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.libraries.ItemBuilder; -import com.songoda.epicvouchers.menus.sub.editor.StringListMenu; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.libraries.ItemBuilder; +import com.craftaro.epicvouchers.menus.sub.editor.StringListMenu; +import com.craftaro.epicvouchers.voucher.Voucher; import org.bukkit.ChatColor; import org.bukkit.Material; diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/ToggleableIcon.java b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/icons/ToggleableIcon.java similarity index 54% rename from src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/ToggleableIcon.java rename to src/main/java/com/craftaro/epicvouchers/libraries/inventory/icons/ToggleableIcon.java index 6c96d25..4299d13 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/ToggleableIcon.java +++ b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/icons/ToggleableIcon.java @@ -1,16 +1,16 @@ -package com.songoda.epicvouchers.libraries.inventory.icons; +package com.craftaro.epicvouchers.libraries.inventory.icons; -import com.songoda.epicvouchers.libraries.ItemBuilder; -import com.songoda.epicvouchers.libraries.inventory.IconInv.IconClickEvent; +import com.craftaro.epicvouchers.libraries.ItemBuilder; +import com.craftaro.epicvouchers.libraries.inventory.IconInv; import org.bukkit.ChatColor; import org.bukkit.Material; import java.util.function.Consumer; public class ToggleableIcon extends Icon { - private final Consumer consumer; + private final Consumer consumer; - public ToggleableIcon(String displayname, Consumer consumer, boolean state) { + public ToggleableIcon(String displayname, Consumer consumer, boolean state) { super(new ItemBuilder(Material.PAPER) .name(ChatColor.YELLOW + displayname) .lore(state ? ChatColor.GREEN + "ENABLED" : ChatColor.RED + "DISABLED") @@ -20,7 +20,7 @@ public class ToggleableIcon extends Icon { } @Override - public void run(IconClickEvent e) { + public void run(IconInv.IconClickEvent e) { this.consumer.accept(e); } } diff --git a/src/main/java/com/songoda/epicvouchers/listeners/PlayerCommandListener.java b/src/main/java/com/craftaro/epicvouchers/listeners/PlayerCommandListener.java similarity index 94% rename from src/main/java/com/songoda/epicvouchers/listeners/PlayerCommandListener.java rename to src/main/java/com/craftaro/epicvouchers/listeners/PlayerCommandListener.java index 856212d..a6fd3d3 100644 --- a/src/main/java/com/songoda/epicvouchers/listeners/PlayerCommandListener.java +++ b/src/main/java/com/craftaro/epicvouchers/listeners/PlayerCommandListener.java @@ -1,4 +1,4 @@ -package com.songoda.epicvouchers.listeners; +package com.craftaro.epicvouchers.listeners; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; diff --git a/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java b/src/main/java/com/craftaro/epicvouchers/listeners/PlayerInteractListener.java similarity index 93% rename from src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java rename to src/main/java/com/craftaro/epicvouchers/listeners/PlayerInteractListener.java index 2e9e0fa..4836e05 100644 --- a/src/main/java/com/songoda/epicvouchers/listeners/PlayerInteractListener.java +++ b/src/main/java/com/craftaro/epicvouchers/listeners/PlayerInteractListener.java @@ -1,10 +1,10 @@ -package com.songoda.epicvouchers.listeners; +package com.craftaro.epicvouchers.listeners; import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.settings.Settings; -import com.songoda.epicvouchers.utils.CachedSet; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.settings.Settings; +import com.craftaro.epicvouchers.utils.CachedSet; +import com.craftaro.epicvouchers.voucher.Voucher; import org.bukkit.ChatColor; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; diff --git a/src/main/java/com/songoda/epicvouchers/menus/ActionMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/ActionMenu.java similarity index 88% rename from src/main/java/com/songoda/epicvouchers/menus/ActionMenu.java rename to src/main/java/com/craftaro/epicvouchers/menus/ActionMenu.java index 1d9a803..977863e 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/ActionMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/ActionMenu.java @@ -1,13 +1,13 @@ -package com.songoda.epicvouchers.menus; +package com.craftaro.epicvouchers.menus; import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.core.utils.TextUtils; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.libraries.ItemBuilder; -import com.songoda.epicvouchers.libraries.inventory.FastInv; -import com.songoda.epicvouchers.menus.sub.action.ForceMenu; -import com.songoda.epicvouchers.menus.sub.action.GiveMenu; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.libraries.ItemBuilder; +import com.craftaro.epicvouchers.libraries.inventory.FastInv; +import com.craftaro.epicvouchers.menus.sub.action.ForceMenu; +import com.craftaro.epicvouchers.menus.sub.action.GiveMenu; +import com.craftaro.epicvouchers.voucher.Voucher; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; diff --git a/src/main/java/com/songoda/epicvouchers/menus/ConfirmMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/ConfirmMenu.java similarity index 89% rename from src/main/java/com/songoda/epicvouchers/menus/ConfirmMenu.java rename to src/main/java/com/craftaro/epicvouchers/menus/ConfirmMenu.java index e1a72cf..3e628df 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/ConfirmMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/ConfirmMenu.java @@ -1,9 +1,9 @@ -package com.songoda.epicvouchers.menus; +package com.craftaro.epicvouchers.menus; import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.libraries.ItemBuilder; -import com.songoda.epicvouchers.libraries.inventory.FastInv; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.libraries.ItemBuilder; +import com.craftaro.epicvouchers.libraries.inventory.FastInv; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/com/songoda/epicvouchers/menus/OptionMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/OptionMenu.java similarity index 85% rename from src/main/java/com/songoda/epicvouchers/menus/OptionMenu.java rename to src/main/java/com/craftaro/epicvouchers/menus/OptionMenu.java index c300653..930650c 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/OptionMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/OptionMenu.java @@ -1,12 +1,12 @@ -package com.songoda.epicvouchers.menus; +package com.craftaro.epicvouchers.menus; import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.core.utils.TextUtils; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.libraries.ItemBuilder; -import com.songoda.epicvouchers.libraries.inventory.FastInv; -import com.songoda.epicvouchers.menus.sub.editor.SetItemMenu; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.libraries.ItemBuilder; +import com.craftaro.epicvouchers.libraries.inventory.FastInv; +import com.craftaro.epicvouchers.menus.sub.editor.SetItemMenu; +import com.craftaro.epicvouchers.voucher.Voucher; import org.bukkit.ChatColor; import static org.bukkit.ChatColor.GRAY; diff --git a/src/main/java/com/songoda/epicvouchers/menus/VoucherEditorMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/VoucherEditorMenu.java similarity index 88% rename from src/main/java/com/songoda/epicvouchers/menus/VoucherEditorMenu.java rename to src/main/java/com/craftaro/epicvouchers/menus/VoucherEditorMenu.java index 0fa70fb..4616a2e 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/VoucherEditorMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/VoucherEditorMenu.java @@ -1,19 +1,19 @@ -package com.songoda.epicvouchers.menus; +package com.craftaro.epicvouchers.menus; import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.core.utils.ItemUtils; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.libraries.ItemBuilder; -import com.songoda.epicvouchers.libraries.inventory.IconInv; -import com.songoda.epicvouchers.libraries.inventory.icons.Icon; -import com.songoda.epicvouchers.libraries.inventory.icons.StringIcon; -import com.songoda.epicvouchers.libraries.inventory.icons.StringListIcon; -import com.songoda.epicvouchers.libraries.inventory.icons.ToggleableIcon; -import com.songoda.epicvouchers.menus.sub.editor.EffectsMenu; -import com.songoda.epicvouchers.menus.sub.editor.ParticlesMenu; -import com.songoda.epicvouchers.menus.sub.editor.SoundsMenu; -import com.songoda.epicvouchers.menus.sub.editor.TitlesMenu; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.libraries.ItemBuilder; +import com.craftaro.epicvouchers.libraries.inventory.IconInv; +import com.craftaro.epicvouchers.libraries.inventory.icons.Icon; +import com.craftaro.epicvouchers.libraries.inventory.icons.StringIcon; +import com.craftaro.epicvouchers.libraries.inventory.icons.StringListIcon; +import com.craftaro.epicvouchers.libraries.inventory.icons.ToggleableIcon; +import com.craftaro.epicvouchers.menus.sub.editor.EffectsMenu; +import com.craftaro.epicvouchers.menus.sub.editor.ParticlesMenu; +import com.craftaro.epicvouchers.menus.sub.editor.SoundsMenu; +import com.craftaro.epicvouchers.menus.sub.editor.TitlesMenu; +import com.craftaro.epicvouchers.voucher.Voucher; import org.apache.commons.lang.StringUtils; import org.bukkit.Material; import org.bukkit.entity.Player; diff --git a/src/main/java/com/songoda/epicvouchers/menus/VoucherMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java similarity index 89% rename from src/main/java/com/songoda/epicvouchers/menus/VoucherMenu.java rename to src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java index 9e5c4b1..787c74c 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/VoucherMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java @@ -1,13 +1,13 @@ -package com.songoda.epicvouchers.menus; +package com.craftaro.epicvouchers.menus; import com.craftaro.core.compatibility.ServerVersion; import com.craftaro.core.gui.AnvilGui; import com.craftaro.core.utils.TextUtils; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.libraries.ItemBuilder; -import com.songoda.epicvouchers.libraries.inventory.IconInv; -import com.songoda.epicvouchers.libraries.inventory.icons.Icon; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.libraries.ItemBuilder; +import com.craftaro.epicvouchers.libraries.inventory.IconInv; +import com.craftaro.epicvouchers.libraries.inventory.icons.Icon; +import com.craftaro.epicvouchers.voucher.Voucher; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/com/songoda/epicvouchers/menus/sub/action/ForceMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/sub/action/ForceMenu.java similarity index 63% rename from src/main/java/com/songoda/epicvouchers/menus/sub/action/ForceMenu.java rename to src/main/java/com/craftaro/epicvouchers/menus/sub/action/ForceMenu.java index 2583623..d24b17a 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/sub/action/ForceMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/sub/action/ForceMenu.java @@ -1,8 +1,8 @@ -package com.songoda.epicvouchers.menus.sub.action; +package com.craftaro.epicvouchers.menus.sub.action; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.libraries.inventory.PlayersMenu; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.libraries.inventory.PlayersMenu; +import com.craftaro.epicvouchers.voucher.Voucher; import org.bukkit.Bukkit; import java.util.ArrayList; diff --git a/src/main/java/com/songoda/epicvouchers/menus/sub/action/GiveMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/sub/action/GiveMenu.java similarity index 62% rename from src/main/java/com/songoda/epicvouchers/menus/sub/action/GiveMenu.java rename to src/main/java/com/craftaro/epicvouchers/menus/sub/action/GiveMenu.java index 99935c8..174ad02 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/sub/action/GiveMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/sub/action/GiveMenu.java @@ -1,8 +1,8 @@ -package com.songoda.epicvouchers.menus.sub.action; +package com.craftaro.epicvouchers.menus.sub.action; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.libraries.inventory.PlayersMenu; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.libraries.inventory.PlayersMenu; +import com.craftaro.epicvouchers.voucher.Voucher; import org.bukkit.Bukkit; import java.util.ArrayList; diff --git a/src/main/java/com/songoda/epicvouchers/menus/sub/editor/EffectsMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/sub/editor/EffectsMenu.java similarity index 71% rename from src/main/java/com/songoda/epicvouchers/menus/sub/editor/EffectsMenu.java rename to src/main/java/com/craftaro/epicvouchers/menus/sub/editor/EffectsMenu.java index e43753b..5d4e297 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/sub/editor/EffectsMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/sub/editor/EffectsMenu.java @@ -1,12 +1,12 @@ -package com.songoda.epicvouchers.menus.sub.editor; +package com.craftaro.epicvouchers.menus.sub.editor; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.libraries.ItemBuilder; -import com.songoda.epicvouchers.libraries.inventory.IconInv; -import com.songoda.epicvouchers.libraries.inventory.icons.IntegerIcon; -import com.songoda.epicvouchers.libraries.inventory.icons.StringIcon; -import com.songoda.epicvouchers.menus.VoucherEditorMenu; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.libraries.ItemBuilder; +import com.craftaro.epicvouchers.libraries.inventory.IconInv; +import com.craftaro.epicvouchers.libraries.inventory.icons.IntegerIcon; +import com.craftaro.epicvouchers.libraries.inventory.icons.StringIcon; +import com.craftaro.epicvouchers.menus.VoucherEditorMenu; +import com.craftaro.epicvouchers.voucher.Voucher; import org.bukkit.Material; import static org.bukkit.ChatColor.GRAY; diff --git a/src/main/java/com/songoda/epicvouchers/menus/sub/editor/ParticlesMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/sub/editor/ParticlesMenu.java similarity index 67% rename from src/main/java/com/songoda/epicvouchers/menus/sub/editor/ParticlesMenu.java rename to src/main/java/com/craftaro/epicvouchers/menus/sub/editor/ParticlesMenu.java index ab91f79..1bbac08 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/sub/editor/ParticlesMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/sub/editor/ParticlesMenu.java @@ -1,12 +1,12 @@ -package com.songoda.epicvouchers.menus.sub.editor; +package com.craftaro.epicvouchers.menus.sub.editor; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.libraries.ItemBuilder; -import com.songoda.epicvouchers.libraries.inventory.IconInv; -import com.songoda.epicvouchers.libraries.inventory.icons.IntegerIcon; -import com.songoda.epicvouchers.libraries.inventory.icons.StringIcon; -import com.songoda.epicvouchers.menus.VoucherEditorMenu; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.libraries.ItemBuilder; +import com.craftaro.epicvouchers.libraries.inventory.IconInv; +import com.craftaro.epicvouchers.libraries.inventory.icons.IntegerIcon; +import com.craftaro.epicvouchers.libraries.inventory.icons.StringIcon; +import com.craftaro.epicvouchers.menus.VoucherEditorMenu; +import com.craftaro.epicvouchers.voucher.Voucher; import org.bukkit.Material; import static org.bukkit.ChatColor.GRAY; diff --git a/src/main/java/com/songoda/epicvouchers/menus/sub/editor/SetItemMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/sub/editor/SetItemMenu.java similarity index 88% rename from src/main/java/com/songoda/epicvouchers/menus/sub/editor/SetItemMenu.java rename to src/main/java/com/craftaro/epicvouchers/menus/sub/editor/SetItemMenu.java index 7f7df33..7317b5e 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/sub/editor/SetItemMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/sub/editor/SetItemMenu.java @@ -1,11 +1,11 @@ -package com.songoda.epicvouchers.menus.sub.editor; +package com.craftaro.epicvouchers.menus.sub.editor; import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.libraries.ItemBuilder; -import com.songoda.epicvouchers.libraries.inventory.FastInv; -import com.songoda.epicvouchers.menus.OptionMenu; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.libraries.ItemBuilder; +import com.craftaro.epicvouchers.libraries.inventory.FastInv; +import com.craftaro.epicvouchers.menus.OptionMenu; +import com.craftaro.epicvouchers.voucher.Voucher; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.event.inventory.ClickType; diff --git a/src/main/java/com/songoda/epicvouchers/menus/sub/editor/SoundsMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/sub/editor/SoundsMenu.java similarity index 69% rename from src/main/java/com/songoda/epicvouchers/menus/sub/editor/SoundsMenu.java rename to src/main/java/com/craftaro/epicvouchers/menus/sub/editor/SoundsMenu.java index ec9db99..42b9d72 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/sub/editor/SoundsMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/sub/editor/SoundsMenu.java @@ -1,13 +1,13 @@ -package com.songoda.epicvouchers.menus.sub.editor; +package com.craftaro.epicvouchers.menus.sub.editor; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.libraries.ItemBuilder; +import com.craftaro.epicvouchers.libraries.inventory.IconInv; +import com.craftaro.epicvouchers.libraries.inventory.icons.IntegerIcon; +import com.craftaro.epicvouchers.libraries.inventory.icons.StringIcon; +import com.craftaro.epicvouchers.menus.VoucherEditorMenu; +import com.craftaro.epicvouchers.voucher.Voucher; import com.google.common.base.Enums; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.libraries.ItemBuilder; -import com.songoda.epicvouchers.libraries.inventory.IconInv; -import com.songoda.epicvouchers.libraries.inventory.icons.IntegerIcon; -import com.songoda.epicvouchers.libraries.inventory.icons.StringIcon; -import com.songoda.epicvouchers.menus.VoucherEditorMenu; -import com.songoda.epicvouchers.voucher.Voucher; import org.bukkit.Material; import org.bukkit.Sound; diff --git a/src/main/java/com/songoda/epicvouchers/menus/sub/editor/StringListMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/sub/editor/StringListMenu.java similarity index 85% rename from src/main/java/com/songoda/epicvouchers/menus/sub/editor/StringListMenu.java rename to src/main/java/com/craftaro/epicvouchers/menus/sub/editor/StringListMenu.java index 3098a23..f0652a3 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/sub/editor/StringListMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/sub/editor/StringListMenu.java @@ -1,13 +1,13 @@ -package com.songoda.epicvouchers.menus.sub.editor; +package com.craftaro.epicvouchers.menus.sub.editor; import com.craftaro.core.input.ChatPrompt; import com.craftaro.core.utils.TextUtils; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.libraries.ItemBuilder; -import com.songoda.epicvouchers.libraries.inventory.IconInv; -import com.songoda.epicvouchers.libraries.inventory.icons.ListEntryIcon; -import com.songoda.epicvouchers.menus.VoucherEditorMenu; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.libraries.ItemBuilder; +import com.craftaro.epicvouchers.libraries.inventory.IconInv; +import com.craftaro.epicvouchers.libraries.inventory.icons.ListEntryIcon; +import com.craftaro.epicvouchers.menus.VoucherEditorMenu; +import com.craftaro.epicvouchers.voucher.Voucher; import org.bukkit.Bukkit; import org.bukkit.Material; diff --git a/src/main/java/com/songoda/epicvouchers/menus/sub/editor/TitlesMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/sub/editor/TitlesMenu.java similarity index 77% rename from src/main/java/com/songoda/epicvouchers/menus/sub/editor/TitlesMenu.java rename to src/main/java/com/craftaro/epicvouchers/menus/sub/editor/TitlesMenu.java index 253663d..567f0b0 100644 --- a/src/main/java/com/songoda/epicvouchers/menus/sub/editor/TitlesMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/sub/editor/TitlesMenu.java @@ -1,12 +1,12 @@ -package com.songoda.epicvouchers.menus.sub.editor; +package com.craftaro.epicvouchers.menus.sub.editor; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.libraries.ItemBuilder; -import com.songoda.epicvouchers.libraries.inventory.IconInv; -import com.songoda.epicvouchers.libraries.inventory.icons.IntegerIcon; -import com.songoda.epicvouchers.libraries.inventory.icons.StringIcon; -import com.songoda.epicvouchers.menus.VoucherEditorMenu; -import com.songoda.epicvouchers.voucher.Voucher; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.libraries.ItemBuilder; +import com.craftaro.epicvouchers.libraries.inventory.IconInv; +import com.craftaro.epicvouchers.libraries.inventory.icons.IntegerIcon; +import com.craftaro.epicvouchers.libraries.inventory.icons.StringIcon; +import com.craftaro.epicvouchers.menus.VoucherEditorMenu; +import com.craftaro.epicvouchers.voucher.Voucher; import org.bukkit.Material; import static org.bukkit.ChatColor.GRAY; diff --git a/src/main/java/com/songoda/epicvouchers/settings/Settings.java b/src/main/java/com/craftaro/epicvouchers/settings/Settings.java similarity index 95% rename from src/main/java/com/songoda/epicvouchers/settings/Settings.java rename to src/main/java/com/craftaro/epicvouchers/settings/Settings.java index dafd736..d49f7bf 100644 --- a/src/main/java/com/songoda/epicvouchers/settings/Settings.java +++ b/src/main/java/com/craftaro/epicvouchers/settings/Settings.java @@ -1,8 +1,8 @@ -package com.songoda.epicvouchers.settings; +package com.craftaro.epicvouchers.settings; import com.craftaro.core.configuration.Config; import com.craftaro.core.configuration.ConfigSetting; -import com.songoda.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.EpicVouchers; import org.bukkit.event.Listener; public class Settings implements Listener { diff --git a/src/main/java/com/songoda/epicvouchers/utils/CachedSet.java b/src/main/java/com/craftaro/epicvouchers/utils/CachedSet.java similarity index 96% rename from src/main/java/com/songoda/epicvouchers/utils/CachedSet.java rename to src/main/java/com/craftaro/epicvouchers/utils/CachedSet.java index 849c8a2..2740bc8 100644 --- a/src/main/java/com/songoda/epicvouchers/utils/CachedSet.java +++ b/src/main/java/com/craftaro/epicvouchers/utils/CachedSet.java @@ -1,4 +1,4 @@ -package com.songoda.epicvouchers.utils; +package com.craftaro.epicvouchers.utils; import java.util.Map; import java.util.WeakHashMap; diff --git a/src/main/java/com/songoda/epicvouchers/utils/Callback.java b/src/main/java/com/craftaro/epicvouchers/utils/Callback.java similarity index 76% rename from src/main/java/com/songoda/epicvouchers/utils/Callback.java rename to src/main/java/com/craftaro/epicvouchers/utils/Callback.java index 0ceed6e..6cb2905 100644 --- a/src/main/java/com/songoda/epicvouchers/utils/Callback.java +++ b/src/main/java/com/craftaro/epicvouchers/utils/Callback.java @@ -1,4 +1,4 @@ -package com.songoda.epicvouchers.utils; +package com.craftaro.epicvouchers.utils; // TODO: Copied from EpicAnchors - Move to SongodaCore (maybe rename too?) public interface Callback { diff --git a/src/main/java/com/songoda/epicvouchers/utils/Pair.java b/src/main/java/com/craftaro/epicvouchers/utils/Pair.java similarity index 98% rename from src/main/java/com/songoda/epicvouchers/utils/Pair.java rename to src/main/java/com/craftaro/epicvouchers/utils/Pair.java index a729018..be289d4 100644 --- a/src/main/java/com/songoda/epicvouchers/utils/Pair.java +++ b/src/main/java/com/craftaro/epicvouchers/utils/Pair.java @@ -1,4 +1,4 @@ -package com.songoda.epicvouchers.utils; +package com.craftaro.epicvouchers.utils; import java.io.Serializable; import java.util.Objects; diff --git a/src/main/java/com/songoda/epicvouchers/utils/ThreadSync.java b/src/main/java/com/craftaro/epicvouchers/utils/ThreadSync.java similarity index 94% rename from src/main/java/com/songoda/epicvouchers/utils/ThreadSync.java rename to src/main/java/com/craftaro/epicvouchers/utils/ThreadSync.java index 4f49af9..8742704 100644 --- a/src/main/java/com/songoda/epicvouchers/utils/ThreadSync.java +++ b/src/main/java/com/craftaro/epicvouchers/utils/ThreadSync.java @@ -1,4 +1,4 @@ -package com.songoda.epicvouchers.utils; +package com.craftaro.epicvouchers.utils; import java.util.concurrent.atomic.AtomicReference; diff --git a/src/main/java/com/songoda/epicvouchers/voucher/CoolDownManager.java b/src/main/java/com/craftaro/epicvouchers/voucher/CoolDownManager.java similarity index 93% rename from src/main/java/com/songoda/epicvouchers/voucher/CoolDownManager.java rename to src/main/java/com/craftaro/epicvouchers/voucher/CoolDownManager.java index aacc87a..5b5ac03 100644 --- a/src/main/java/com/songoda/epicvouchers/voucher/CoolDownManager.java +++ b/src/main/java/com/craftaro/epicvouchers/voucher/CoolDownManager.java @@ -1,6 +1,6 @@ -package com.songoda.epicvouchers.voucher; +package com.craftaro.epicvouchers.voucher; -import com.songoda.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.EpicVouchers; import org.bukkit.Bukkit; import java.util.HashMap; diff --git a/src/main/java/com/songoda/epicvouchers/voucher/Voucher.java b/src/main/java/com/craftaro/epicvouchers/voucher/Voucher.java similarity index 98% rename from src/main/java/com/songoda/epicvouchers/voucher/Voucher.java rename to src/main/java/com/craftaro/epicvouchers/voucher/Voucher.java index 53248d9..9f210d9 100644 --- a/src/main/java/com/songoda/epicvouchers/voucher/Voucher.java +++ b/src/main/java/com/craftaro/epicvouchers/voucher/Voucher.java @@ -1,14 +1,14 @@ -package com.songoda.epicvouchers.voucher; +package com.craftaro.epicvouchers.voucher; import com.craftaro.core.compatibility.ServerVersion; import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem; import com.craftaro.core.utils.ItemUtils; import com.craftaro.core.utils.TextUtils; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.events.ForceRedeemEvent; -import com.songoda.epicvouchers.events.VoucherReceiveEvent; -import com.songoda.epicvouchers.menus.ConfirmMenu; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.events.ForceRedeemEvent; +import com.craftaro.epicvouchers.events.VoucherReceiveEvent; +import com.craftaro.epicvouchers.menus.ConfirmMenu; import lombok.experimental.Accessors; import org.bukkit.Bukkit; import org.bukkit.Material; diff --git a/src/main/java/com/songoda/epicvouchers/voucher/VoucherExecutor.java b/src/main/java/com/craftaro/epicvouchers/voucher/VoucherExecutor.java similarity index 97% rename from src/main/java/com/songoda/epicvouchers/voucher/VoucherExecutor.java rename to src/main/java/com/craftaro/epicvouchers/voucher/VoucherExecutor.java index 43b23b1..bd3c481 100644 --- a/src/main/java/com/songoda/epicvouchers/voucher/VoucherExecutor.java +++ b/src/main/java/com/craftaro/epicvouchers/voucher/VoucherExecutor.java @@ -1,10 +1,10 @@ -package com.songoda.epicvouchers.voucher; +package com.craftaro.epicvouchers.voucher; import com.craftaro.core.compatibility.CompatibleSound; import com.craftaro.core.compatibility.ServerVersion; -import com.songoda.epicvouchers.EpicVouchers; -import com.songoda.epicvouchers.events.VoucherRedeemEvent; -import com.songoda.epicvouchers.listeners.PlayerCommandListener; +import com.craftaro.epicvouchers.EpicVouchers; +import com.craftaro.epicvouchers.events.VoucherRedeemEvent; +import com.craftaro.epicvouchers.listeners.PlayerCommandListener; import org.apache.commons.lang.StringUtils; import org.bukkit.Bukkit; import org.bukkit.Effect; diff --git a/src/main/java/com/songoda/epicvouchers/voucher/VoucherManager.java b/src/main/java/com/craftaro/epicvouchers/voucher/VoucherManager.java similarity index 94% rename from src/main/java/com/songoda/epicvouchers/voucher/VoucherManager.java rename to src/main/java/com/craftaro/epicvouchers/voucher/VoucherManager.java index 5bf9c48..2156530 100644 --- a/src/main/java/com/songoda/epicvouchers/voucher/VoucherManager.java +++ b/src/main/java/com/craftaro/epicvouchers/voucher/VoucherManager.java @@ -1,4 +1,4 @@ -package com.songoda.epicvouchers.voucher; +package com.craftaro.epicvouchers.voucher; import java.util.Collection; import java.util.HashMap; diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 982742c..8df8b72 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -3,7 +3,7 @@ description: ${project.description} version: ${project.version} api-version: 1.13 -main: com.songoda.epicvouchers.EpicVouchers +main: com.craftaro.epicvouchers.EpicVouchers author: Craftaro website: ${project.url} diff --git a/src/main/resources/vouchers.yml b/src/main/resources/vouchers.yml index 0d85345..7eb4f08 100644 --- a/src/main/resources/vouchers.yml +++ b/src/main/resources/vouchers.yml @@ -12,7 +12,7 @@ vouchers: - "ðis nice cookie will tell you." - "" - "&cWhat could be inside this voucher?" - - "&6- Songoda" + - "&6- Craftaro" glow: true confirm: true unbreakable: true From e9b6a5ad80a00e523136170cf20f9bc0c13acc79 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Tue, 18 Jul 2023 15:34:31 +0200 Subject: [PATCH 10/13] Release v3.0.0-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 710eac1..32e629b 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.craftaro EpicVouchers-Plugin - 2.2.6 + 3.0.0-SNAPSHOT EpicVouchers Create vouchers that players can claim for rewards with seemingly infinite possibilities From b4cb9b2569f0be0fb33108f4a9de167e3bb55ba1 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Mon, 23 Oct 2023 18:12:59 +0200 Subject: [PATCH 11/13] Release v3.0.0-b2-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 32e629b..eb0372e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.craftaro EpicVouchers-Plugin - 3.0.0-SNAPSHOT + 3.0.0-b2-SNAPSHOT EpicVouchers Create vouchers that players can claim for rewards with seemingly infinite possibilities From b65cea5fa4ab3d334116c1598c93973ba006eb27 Mon Sep 17 00:00:00 2001 From: ceze88 Date: Thu, 11 Jan 2024 16:13:13 +0100 Subject: [PATCH 12/13] Migrate to dynamic dependency loading --- pom.xml | 16 ++++++++++++++++ .../com/craftaro/epicvouchers/EpicVouchers.java | 10 +++++++++- .../libraries/inventory/PlayersMenu.java | 4 ++-- .../craftaro/epicvouchers/menus/ActionMenu.java | 2 +- .../craftaro/epicvouchers/menus/ConfirmMenu.java | 2 +- .../craftaro/epicvouchers/menus/OptionMenu.java | 2 +- .../epicvouchers/menus/VoucherEditorMenu.java | 2 +- .../menus/sub/editor/SetItemMenu.java | 2 +- .../craftaro/epicvouchers/voucher/Voucher.java | 2 +- 9 files changed, 33 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index eb0372e..1f2c997 100644 --- a/pom.xml +++ b/pom.xml @@ -58,6 +58,22 @@ LICENSE.** + + + com.craftaro:CraftaroCore + false + + **/third_party/org/apache/** + **/third_party/net/kyori/** + **/third_party/com/zaxxer/** + **/third_party/org/jooq/** + **/third_party/org/mariadb/** + **/third_party/com/h2database/** + **/third_party/org/h2/** + **/third_party/com/cryptomorin/** + **/third_party/org/reactivestreams/** + + diff --git a/src/main/java/com/craftaro/epicvouchers/EpicVouchers.java b/src/main/java/com/craftaro/epicvouchers/EpicVouchers.java index ec089df..7206876 100644 --- a/src/main/java/com/craftaro/epicvouchers/EpicVouchers.java +++ b/src/main/java/com/craftaro/epicvouchers/EpicVouchers.java @@ -4,8 +4,9 @@ import com.craftaro.core.SongodaCore; import com.craftaro.core.SongodaPlugin; import com.craftaro.core.commands.CommandManager; import com.craftaro.core.configuration.Config; +import com.craftaro.core.dependency.Dependency; import com.craftaro.core.gui.GuiManager; -import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.epicvouchers.commands.CommandEditor; import com.craftaro.epicvouchers.commands.CommandEpicVouchers; import com.craftaro.epicvouchers.commands.CommandForce; @@ -34,7 +35,9 @@ import org.bukkit.plugin.PluginManager; import java.io.File; import java.util.Collection; import java.util.Collections; +import java.util.HashSet; import java.util.List; +import java.util.Set; public class EpicVouchers extends SongodaPlugin { private final GuiManager guiManager = new GuiManager(this); @@ -54,6 +57,11 @@ public class EpicVouchers extends SongodaPlugin { return getPlugin(EpicVouchers.class); } + @Override + protected Set getDependencies() { + return new HashSet<>(); + } + @Override public void onPluginLoad() { } diff --git a/src/main/java/com/craftaro/epicvouchers/libraries/inventory/PlayersMenu.java b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/PlayersMenu.java index 4906910..b9bfb00 100644 --- a/src/main/java/com/craftaro/epicvouchers/libraries/inventory/PlayersMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/PlayersMenu.java @@ -1,7 +1,7 @@ package com.craftaro.epicvouchers.libraries.inventory; -import com.craftaro.core.third_party.com.cryptomorin.xseries.SkullUtils; -import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.third_party.com.cryptomorin.xseries.SkullUtils; +import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.epicvouchers.EpicVouchers; import com.craftaro.epicvouchers.libraries.ItemBuilder; import com.craftaro.epicvouchers.menus.ActionMenu; diff --git a/src/main/java/com/craftaro/epicvouchers/menus/ActionMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/ActionMenu.java index 977863e..255577f 100644 --- a/src/main/java/com/craftaro/epicvouchers/menus/ActionMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/ActionMenu.java @@ -1,6 +1,6 @@ package com.craftaro.epicvouchers.menus; -import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.core.utils.TextUtils; import com.craftaro.epicvouchers.EpicVouchers; import com.craftaro.epicvouchers.libraries.ItemBuilder; diff --git a/src/main/java/com/craftaro/epicvouchers/menus/ConfirmMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/ConfirmMenu.java index 3e628df..7a69d85 100644 --- a/src/main/java/com/craftaro/epicvouchers/menus/ConfirmMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/ConfirmMenu.java @@ -1,6 +1,6 @@ package com.craftaro.epicvouchers.menus; -import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.epicvouchers.EpicVouchers; import com.craftaro.epicvouchers.libraries.ItemBuilder; import com.craftaro.epicvouchers.libraries.inventory.FastInv; diff --git a/src/main/java/com/craftaro/epicvouchers/menus/OptionMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/OptionMenu.java index 930650c..40f12e8 100644 --- a/src/main/java/com/craftaro/epicvouchers/menus/OptionMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/OptionMenu.java @@ -1,6 +1,6 @@ package com.craftaro.epicvouchers.menus; -import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.core.utils.TextUtils; import com.craftaro.epicvouchers.EpicVouchers; import com.craftaro.epicvouchers.libraries.ItemBuilder; diff --git a/src/main/java/com/craftaro/epicvouchers/menus/VoucherEditorMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/VoucherEditorMenu.java index 4616a2e..6a22778 100644 --- a/src/main/java/com/craftaro/epicvouchers/menus/VoucherEditorMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/VoucherEditorMenu.java @@ -1,6 +1,6 @@ package com.craftaro.epicvouchers.menus; -import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.core.utils.ItemUtils; import com.craftaro.epicvouchers.EpicVouchers; import com.craftaro.epicvouchers.libraries.ItemBuilder; diff --git a/src/main/java/com/craftaro/epicvouchers/menus/sub/editor/SetItemMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/sub/editor/SetItemMenu.java index 7317b5e..8211c76 100644 --- a/src/main/java/com/craftaro/epicvouchers/menus/sub/editor/SetItemMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/sub/editor/SetItemMenu.java @@ -1,6 +1,6 @@ package com.craftaro.epicvouchers.menus.sub.editor; -import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.epicvouchers.EpicVouchers; import com.craftaro.epicvouchers.libraries.ItemBuilder; import com.craftaro.epicvouchers.libraries.inventory.FastInv; diff --git a/src/main/java/com/craftaro/epicvouchers/voucher/Voucher.java b/src/main/java/com/craftaro/epicvouchers/voucher/Voucher.java index 9f210d9..001d781 100644 --- a/src/main/java/com/craftaro/epicvouchers/voucher/Voucher.java +++ b/src/main/java/com/craftaro/epicvouchers/voucher/Voucher.java @@ -1,7 +1,7 @@ package com.craftaro.epicvouchers.voucher; import com.craftaro.core.compatibility.ServerVersion; -import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem; import com.craftaro.core.utils.ItemUtils; import com.craftaro.core.utils.TextUtils; From 5b776bf221202ece341c53b030a896030be60751 Mon Sep 17 00:00:00 2001 From: ceze88 Date: Sat, 13 Jan 2024 15:55:48 +0100 Subject: [PATCH 13/13] Release v3.0.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1f2c997..8678c3d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.craftaro EpicVouchers-Plugin - 3.0.0-b2-SNAPSHOT + 3.0.0 EpicVouchers Create vouchers that players can claim for rewards with seemingly infinite possibilities