From 57746b195c4ce46085f89403564687e014bb0078 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Sat, 13 Jan 2024 22:12:47 +0100 Subject: [PATCH 01/18] Removes now no-longer needed `#getDependencies` from plugin main class The core now provides an implementation which returns an empty Set --- .../java/com/craftaro/epicvouchers/EpicVouchers.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/main/java/com/craftaro/epicvouchers/EpicVouchers.java b/src/main/java/com/craftaro/epicvouchers/EpicVouchers.java index 7206876..d14e698 100644 --- a/src/main/java/com/craftaro/epicvouchers/EpicVouchers.java +++ b/src/main/java/com/craftaro/epicvouchers/EpicVouchers.java @@ -4,9 +4,7 @@ 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.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.epicvouchers.commands.CommandEditor; import com.craftaro.epicvouchers.commands.CommandEpicVouchers; import com.craftaro.epicvouchers.commands.CommandForce; @@ -27,6 +25,7 @@ import com.craftaro.epicvouchers.voucher.Voucher; import com.craftaro.epicvouchers.voucher.VoucherExecutor; import com.craftaro.epicvouchers.voucher.VoucherManager; +import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; @@ -35,9 +34,7 @@ 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); @@ -57,11 +54,6 @@ public static EpicVouchers getInstance() { return getPlugin(EpicVouchers.class); } - @Override - protected Set getDependencies() { - return new HashSet<>(); - } - @Override public void onPluginLoad() { } From abb770ef654691fa3ff2e3d30e547176a9a67a01 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Wed, 27 Mar 2024 09:43:40 +0100 Subject: [PATCH 02/18] fix: Replaces usage of depreacted CompatibleSound with XSound The CompatibleSound class will be removed from the Core and this ensures compatibility with new versions of the Core and newer Minecraft versions --- .../craftaro/epicvouchers/voucher/VoucherExecutor.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/craftaro/epicvouchers/voucher/VoucherExecutor.java b/src/main/java/com/craftaro/epicvouchers/voucher/VoucherExecutor.java index bd3c481..d54986a 100644 --- a/src/main/java/com/craftaro/epicvouchers/voucher/VoucherExecutor.java +++ b/src/main/java/com/craftaro/epicvouchers/voucher/VoucherExecutor.java @@ -1,10 +1,10 @@ package com.craftaro.epicvouchers.voucher; -import com.craftaro.core.compatibility.CompatibleSound; import com.craftaro.core.compatibility.ServerVersion; import com.craftaro.epicvouchers.EpicVouchers; import com.craftaro.epicvouchers.events.VoucherRedeemEvent; import com.craftaro.epicvouchers.listeners.PlayerCommandListener; +import com.craftaro.third_party.com.cryptomorin.xseries.XSound; import org.apache.commons.lang.StringUtils; import org.bukkit.Bukkit; import org.bukkit.Effect; @@ -15,6 +15,7 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import java.util.Optional; import java.util.logging.Level; public class VoucherExecutor { @@ -142,11 +143,8 @@ public void redeemVoucher(Player player, Voucher voucher, ItemStack item, boolea } if (voucher.getSound() != null && !voucher.getSound().isEmpty()) { - try { - CompatibleSound sound = CompatibleSound.valueOf(voucher.getSound()); - sound.play(player, Integer.MAX_VALUE, voucher.getSoundPitch()); - } catch (IllegalArgumentException ignored) { - } + Optional sound = XSound.matchXSound(voucher.getSound()); + sound.ifPresent(xSound -> xSound.play(player, 1.0f, voucher.getSoundPitch())); } String particle = voucher.getParticle(); From 9a2cdffcb78c7312a593dddceae585cafbeb389e Mon Sep 17 00:00:00 2001 From: xsmeths Date: Sun, 14 Apr 2024 22:27:16 +0100 Subject: [PATCH 03/18] include nms packages --- pom.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pom.xml b/pom.xml index 8678c3d..8c55f77 100644 --- a/pom.xml +++ b/pom.xml @@ -62,6 +62,9 @@ com.craftaro:CraftaroCore false + + **/nms/v*/** + **/third_party/org/apache/** **/third_party/net/kyori/** From 5c29ac1850e52c99dcf96fffe55323b4720c2f4f Mon Sep 17 00:00:00 2001 From: xsmeths Date: Sun, 14 Apr 2024 22:28:47 +0100 Subject: [PATCH 04/18] fix editor command --- .../java/com/craftaro/epicvouchers/commands/CommandEditor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/craftaro/epicvouchers/commands/CommandEditor.java b/src/main/java/com/craftaro/epicvouchers/commands/CommandEditor.java index 26d63ec..57f5d1e 100644 --- a/src/main/java/com/craftaro/epicvouchers/commands/CommandEditor.java +++ b/src/main/java/com/craftaro/epicvouchers/commands/CommandEditor.java @@ -12,7 +12,7 @@ public class CommandEditor extends AbstractCommand { final EpicVouchers instance; public CommandEditor(EpicVouchers instance) { - super(CommandType.PLAYER_ONLY, "EpicVouchers"); + super(CommandType.PLAYER_ONLY, "editor"); this.instance = instance; } From ea3445280e294869bafe1f589501a64a273a2d6f Mon Sep 17 00:00:00 2001 From: xsmeths Date: Mon, 15 Apr 2024 00:06:09 +0100 Subject: [PATCH 05/18] Correctly show voucher item names in editor main menu --- .../com/craftaro/epicvouchers/menus/VoucherMenu.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java index 787c74c..f02cb84 100644 --- a/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java @@ -8,9 +8,11 @@ import com.craftaro.epicvouchers.libraries.inventory.IconInv; import com.craftaro.epicvouchers.libraries.inventory.icons.Icon; import com.craftaro.epicvouchers.voucher.Voucher; +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; import static org.bukkit.Material.PAPER; @@ -25,7 +27,12 @@ public VoucherMenu(EpicVouchers instance) { for (Voucher voucher : instance.getVoucherManager().getVouchers()) { if (getInventory().firstEmpty() != -1) { - addIcon(getInventory().firstEmpty(), voucher.toItemStack(), event -> new OptionMenu(instance, voucher).open(event.getPlayer())); + ItemStack voucherr = voucher.toItemStack(); + ItemMeta vouchermeta = voucherr.getItemMeta(); + vouchermeta.setDisplayName(voucher.getName()); + Bukkit.broadcastMessage(voucher.getName()); + voucherr.setItemMeta(vouchermeta); + addIcon(getInventory().firstEmpty(), voucherr, event -> new OptionMenu(instance, voucher).open(event.getPlayer())); } } From 2a74183821560f912f45e9871ea33b1242773a17 Mon Sep 17 00:00:00 2001 From: xsmeths Date: Mon, 15 Apr 2024 00:09:42 +0100 Subject: [PATCH 06/18] remove a debug line --- src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java index f02cb84..647cda0 100644 --- a/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java @@ -30,7 +30,6 @@ public VoucherMenu(EpicVouchers instance) { ItemStack voucherr = voucher.toItemStack(); ItemMeta vouchermeta = voucherr.getItemMeta(); vouchermeta.setDisplayName(voucher.getName()); - Bukkit.broadcastMessage(voucher.getName()); voucherr.setItemMeta(vouchermeta); addIcon(getInventory().firstEmpty(), voucherr, event -> new OptionMenu(instance, voucher).open(event.getPlayer())); } From fc0e3ef7c038f2daac2741b2a3a26eba3a563183 Mon Sep 17 00:00:00 2001 From: xsmeths Date: Mon, 15 Apr 2024 00:18:00 +0100 Subject: [PATCH 07/18] translate colors for editor menu items that were just created --- src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java index 647cda0..d032bb5 100644 --- a/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java @@ -29,7 +29,7 @@ public VoucherMenu(EpicVouchers instance) { if (getInventory().firstEmpty() != -1) { ItemStack voucherr = voucher.toItemStack(); ItemMeta vouchermeta = voucherr.getItemMeta(); - vouchermeta.setDisplayName(voucher.getName()); + vouchermeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', voucher.getName())); voucherr.setItemMeta(vouchermeta); addIcon(getInventory().firstEmpty(), voucherr, event -> new OptionMenu(instance, voucher).open(event.getPlayer())); } From c76cbe8de844381c042b31935c7a9aef94efc94d Mon Sep 17 00:00:00 2001 From: xsmeths Date: Mon, 15 Apr 2024 02:59:07 +0100 Subject: [PATCH 08/18] less horrible naming --- .../com/craftaro/epicvouchers/menus/VoucherMenu.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java index d032bb5..25ef9d6 100644 --- a/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java @@ -27,11 +27,11 @@ public VoucherMenu(EpicVouchers instance) { for (Voucher voucher : instance.getVoucherManager().getVouchers()) { if (getInventory().firstEmpty() != -1) { - ItemStack voucherr = voucher.toItemStack(); - ItemMeta vouchermeta = voucherr.getItemMeta(); - vouchermeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', voucher.getName())); - voucherr.setItemMeta(vouchermeta); - addIcon(getInventory().firstEmpty(), voucherr, event -> new OptionMenu(instance, voucher).open(event.getPlayer())); + ItemStack voucherItemStack = voucher.toItemStack(); + ItemMeta voucherItemMeta = voucherItemStack.getItemMeta(); + voucherItemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', voucher.getName())); + voucherItemStack.setItemMeta(voucherItemMeta); + addIcon(getInventory().firstEmpty(), voucherItemStack, event -> new OptionMenu(instance, voucher).open(event.getPlayer())); } } From 70cc75b27f6c3839eeea5c4a376f8f594ae3c871 Mon Sep 17 00:00:00 2001 From: xsmeths Date: Mon, 15 Apr 2024 06:05:08 +0100 Subject: [PATCH 09/18] more menu fixes stop people making vouchers with no id make it so the anvil gui logic updates your exp back to what it was after using it TextUtils for formatting --- .../epicvouchers/menus/VoucherMenu.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java index 25ef9d6..c2ff76d 100644 --- a/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/VoucherMenu.java @@ -29,7 +29,7 @@ public VoucherMenu(EpicVouchers instance) { if (getInventory().firstEmpty() != -1) { ItemStack voucherItemStack = voucher.toItemStack(); ItemMeta voucherItemMeta = voucherItemStack.getItemMeta(); - voucherItemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', voucher.getName())); + voucherItemMeta.setDisplayName(TextUtils.formatText(voucher.getName())); voucherItemStack.setItemMeta(voucherItemMeta); addIcon(getInventory().firstEmpty(), voucherItemStack, event -> new OptionMenu(instance, voucher).open(event.getPlayer())); } @@ -42,19 +42,23 @@ public VoucherMenu(EpicVouchers instance) { gui.setTitle("Insert id"); gui.setAction(aEvent -> { final String msg = gui.getInputText().trim(); + aEvent.player.setLevel(aEvent.player.getLevel()+1); + aEvent.player.updateInventory(); + aEvent.player.setLevel(aEvent.player.getLevel()-1); + aEvent.player.updateInventory(); if (instance.getVoucherManager().getVoucher(msg) != null) { event.getPlayer().sendMessage(TextUtils.formatText("&cAlready a voucher registered with the id: " + msg)); new VoucherMenu(instance).open(event.getPlayer()); return; } - - Voucher voucher = new Voucher(msg, instance); - voucher.setMaterial(PAPER); - voucher.setName("&f" + msg); - voucher.setTexture(""); - - instance.getVoucherManager().addVoucher(voucher); - event.getPlayer().sendMessage(TextUtils.formatText("&7Successfully created voucher with id &r" + msg + "&7.")); + if (!msg.isEmpty()) { + Voucher voucher = new Voucher(msg, instance); + voucher.setMaterial(PAPER); + voucher.setName("&f" + msg); + voucher.setTexture(""); + instance.getVoucherManager().addVoucher(voucher); + event.getPlayer().sendMessage(TextUtils.formatText("&7Successfully created voucher with id &r" + msg + "&7.")); + } new VoucherMenu(instance).open(event.getPlayer()); }); instance.getGuiManager().showGUI(event.getPlayer(), gui); @@ -65,3 +69,4 @@ public VoucherMenu(EpicVouchers instance) { new ItemStack(Material.valueOf("STAINED_GLASS_PANE"), 1, (short) 7)).name(ChatColor.RESET.toString()).build())); } } + From 01508fce33a4c5fdcf8a02bbadf2253cd9944191 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Sat, 22 Jun 2024 15:50:01 +0200 Subject: [PATCH 10/18] chore(deps): update maven-shade-plugin to v3.6.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8c55f77..b2a22f4 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.5.0 + 3.6.0 From 23079d068e2c5473f1658740bdf2f40b00deda15 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Sat, 22 Jun 2024 15:52:30 +0200 Subject: [PATCH 11/18] chore(deps): update SongodaCore to v3.1.0-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b2a22f4..98be3fe 100644 --- a/pom.xml +++ b/pom.xml @@ -108,7 +108,7 @@ com.craftaro CraftaroCore - 3.0.0-SNAPSHOT + 3.1.0-SNAPSHOT compile From 99eb5d9e542b7286634d450ea4af8dc6582b6b1c Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Sat, 22 Jun 2024 15:52:38 +0200 Subject: [PATCH 12/18] fix: replace usage of deleted SkullUtils class with XSkull Updating the Core also updated XSeries which got rid of SkullUtils in favor of new methods in XSkull --- .../epicvouchers/libraries/inventory/PlayersMenu.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 b9bfb00..23cf037 100644 --- a/src/main/java/com/craftaro/epicvouchers/libraries/inventory/PlayersMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/PlayersMenu.java @@ -1,11 +1,12 @@ package com.craftaro.epicvouchers.libraries.inventory; -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; import com.craftaro.epicvouchers.voucher.Voucher; +import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial; +import com.craftaro.third_party.com.cryptomorin.xseries.profiles.builder.XSkull; +import com.craftaro.third_party.com.cryptomorin.xseries.profiles.objects.Profileable; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -53,7 +54,7 @@ public void refresh() { Player player = this.players.get(index); - ItemStack itemStack = SkullUtils.getSkull(player.getUniqueId()); + ItemStack itemStack = XSkull.createItem().profile(new Profileable.OfflinePlayerProfileable(player)).apply(); ItemMeta itemMeta = itemStack.getItemMeta(); itemMeta.setDisplayName(YELLOW + player.getName()); From b0e51c1ac83b73f34a82c08fd415acb1b149f68b Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Sat, 22 Jun 2024 16:01:15 +0200 Subject: [PATCH 13/18] chore(deps): update org.projectlombok:lombok from v1.18.20 to v1.18.32 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 98be3fe..40e5edb 100644 --- a/pom.xml +++ b/pom.xml @@ -122,7 +122,7 @@ org.projectlombok lombok - 1.18.20 + 1.18.32 provided From f4c1b02ed74b4dc45384d44542672b0e18fda759 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Sat, 22 Jun 2024 20:25:05 +0200 Subject: [PATCH 14/18] fix: shade kyori adventure --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 40e5edb..2c9733b 100644 --- a/pom.xml +++ b/pom.xml @@ -64,10 +64,10 @@ false **/nms/v*/** + **/third_party/net/kyori/** **/third_party/org/apache/** - **/third_party/net/kyori/** **/third_party/com/zaxxer/** **/third_party/org/jooq/** **/third_party/org/mariadb/** From 8dc83033bd8bc959894a2cb3715b5c8b09e73ffd Mon Sep 17 00:00:00 2001 From: ceze88 Date: Wed, 21 Aug 2024 17:38:33 +0200 Subject: [PATCH 15/18] Update to core version 3.3.0-SNAPSHOT --- pom.xml | 2 +- .../libraries/inventory/PlayersMenu.java | 3 ++- .../com/craftaro/epicvouchers/menus/ConfirmMenu.java | 10 +++++----- .../com/craftaro/epicvouchers/voucher/Voucher.java | 12 +++++++----- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index 2c9733b..abfbaa7 100644 --- a/pom.xml +++ b/pom.xml @@ -108,7 +108,7 @@ com.craftaro CraftaroCore - 3.1.0-SNAPSHOT + 3.3.0-SNAPSHOT compile 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 23cf037..3a6be4a 100644 --- a/src/main/java/com/craftaro/epicvouchers/libraries/inventory/PlayersMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/PlayersMenu.java @@ -1,5 +1,6 @@ package com.craftaro.epicvouchers.libraries.inventory; +import com.craftaro.core.utils.SkullItemCreator; import com.craftaro.epicvouchers.EpicVouchers; import com.craftaro.epicvouchers.libraries.ItemBuilder; import com.craftaro.epicvouchers.menus.ActionMenu; @@ -54,7 +55,7 @@ public void refresh() { Player player = this.players.get(index); - ItemStack itemStack = XSkull.createItem().profile(new Profileable.OfflinePlayerProfileable(player)).apply(); + ItemStack itemStack = SkullItemCreator.byPlayer(player); ItemMeta itemMeta = itemStack.getItemMeta(); itemMeta.setDisplayName(YELLOW + player.getName()); diff --git a/src/main/java/com/craftaro/epicvouchers/menus/ConfirmMenu.java b/src/main/java/com/craftaro/epicvouchers/menus/ConfirmMenu.java index 7a69d85..22f570f 100644 --- a/src/main/java/com/craftaro/epicvouchers/menus/ConfirmMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/menus/ConfirmMenu.java @@ -13,19 +13,19 @@ public class ConfirmMenu extends FastInv { public ConfirmMenu(EpicVouchers instance, Runnable success, Runnable failure) { - super(27, instance.getLocale().getMessage("interface.confirmsettings.title").getMessage()); + super(27, instance.getLocale().getMessage("interface.confirmsettings.title").toText()); addItem(11, new ItemBuilder(Material.EMERALD) - .name(instance.getLocale().getMessage("interface.confirmsettings.confirmitemname").getMessage()) - .lore(instance.getLocale().getMessage("interface.confirmsettings.confirmitemlore").getMessage()) + .name(instance.getLocale().getMessage("interface.confirmsettings.confirmitemname").toText()) + .lore(instance.getLocale().getMessage("interface.confirmsettings.confirmitemlore").toText()) .addGlow().build(), event -> { event.getPlayer().closeInventory(); success.run(); }); addItem(15, new ItemBuilder(Material.REDSTONE_BLOCK) - .name(instance.getLocale().getMessage("interface.confirmsettings.cancelitemname").getMessage()) - .lore(instance.getLocale().getMessage("interface.confirmsettings.cancelitemlore").getMessage()) + .name(instance.getLocale().getMessage("interface.confirmsettings.cancelitemname").toText()) + .lore(instance.getLocale().getMessage("interface.confirmsettings.cancelitemlore").toText()) .enchant(DURABILITY, 1) .addFlags(HIDE_ENCHANTS) .build(), event -> { diff --git a/src/main/java/com/craftaro/epicvouchers/voucher/Voucher.java b/src/main/java/com/craftaro/epicvouchers/voucher/Voucher.java index 001d781..9b32570 100644 --- a/src/main/java/com/craftaro/epicvouchers/voucher/Voucher.java +++ b/src/main/java/com/craftaro/epicvouchers/voucher/Voucher.java @@ -1,6 +1,8 @@ package com.craftaro.epicvouchers.voucher; +import com.craftaro.core.chat.AdventureUtils; import com.craftaro.core.compatibility.ServerVersion; +import com.craftaro.core.third_party.net.kyori.adventure.text.Component; 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; @@ -196,13 +198,13 @@ public void giveAll(CommandSender sender, int amount) { } public void give(CommandSender sender, List players, int amount) { - String giveMessage = this.instance.getLocale().getMessage("command.give.send") + Component 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 = this.instance.getLocale().getMessage("command.give.receive") + Component receiveMessage = this.instance.getLocale().getMessage("command.give.receive") .processPlaceholder("voucher", getName(true)) .processPlaceholder("player", player.getName()) .processPlaceholder("amount", String.valueOf(amount)).getPrefixedMessage(); @@ -215,11 +217,11 @@ public void give(CommandSender sender, List players, int amount) { continue; } - player.sendMessage(receiveMessage); + AdventureUtils.sendMessage(EpicVouchers.getInstance(), receiveMessage, player); player.getInventory().addItem(toItemStack(amount)); } - sender.sendMessage(giveMessage); + AdventureUtils.sendMessage(EpicVouchers.getInstance(), giveMessage, sender); } public void forceRedeem(CommandSender sender, List players, int amount) { @@ -242,7 +244,7 @@ public void redeemVoucher(PlayerInteractEvent event) { // does the player have permission to redeem this voucher? if (!this.permission.isEmpty() && !player.hasPermission(this.permission)) { - player.sendMessage(this.instance.getLocale().getMessage("event.general.nopermission").getPrefixedMessage()); + this.instance.getLocale().getMessage("event.general.nopermission").sendPrefixedMessage(player); return; } From ee3df6e811d3f6fb2fb92e20bc4b3806414b6b20 Mon Sep 17 00:00:00 2001 From: ceze88 Date: Wed, 21 Aug 2024 17:38:43 +0200 Subject: [PATCH 16/18] Release v3.1.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index abfbaa7..0b5e737 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.craftaro EpicVouchers-Plugin - 3.0.0 + 3.1.1 EpicVouchers Create vouchers that players can claim for rewards with seemingly infinite possibilities From 1ee36c2de4c401e9b6f5efa37e219394568523b3 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Wed, 2 Oct 2024 15:38:29 +0200 Subject: [PATCH 17/18] chore: Update SongodaCore to v3.5.0-SNAPSHOT --- pom.xml | 2 +- .../craftaro/epicvouchers/libraries/inventory/PlayersMenu.java | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 0b5e737..d5ee858 100644 --- a/pom.xml +++ b/pom.xml @@ -108,7 +108,7 @@ com.craftaro CraftaroCore - 3.3.0-SNAPSHOT + 3.5.0-SNAPSHOT compile 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 3a6be4a..bfed7ec 100644 --- a/src/main/java/com/craftaro/epicvouchers/libraries/inventory/PlayersMenu.java +++ b/src/main/java/com/craftaro/epicvouchers/libraries/inventory/PlayersMenu.java @@ -6,8 +6,6 @@ import com.craftaro.epicvouchers.menus.ActionMenu; import com.craftaro.epicvouchers.voucher.Voucher; import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial; -import com.craftaro.third_party.com.cryptomorin.xseries.profiles.builder.XSkull; -import com.craftaro.third_party.com.cryptomorin.xseries.profiles.objects.Profileable; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; From a50ccb95a658b2cce6e244e0adf0c414d944a0db Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Wed, 2 Oct 2024 15:38:35 +0200 Subject: [PATCH 18/18] Release v3.2.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d5ee858..529a612 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.craftaro EpicVouchers-Plugin - 3.1.1 + 3.2.0 EpicVouchers Create vouchers that players can claim for rewards with seemingly infinite possibilities