From b1132eb6b4dd51428890bcb9998ffa294e731d37 Mon Sep 17 00:00:00 2001 From: BenceX100 <52270269+BenceX100@users.noreply.github.com> Date: Mon, 13 May 2024 19:24:39 +0200 Subject: [PATCH] Progress --- pom.xml | 33 ++++++++++++++++--- .../artillexstudios/axtrade/trade/Trade.java | 3 ++ .../axtrade/utils/ItemBuilderUtil.java | 4 +-- .../axtrade/utils/ShulkerUtils.java | 2 +- src/main/resources/config.yml | 2 +- src/main/resources/guis.yml | 1 - 6 files changed, 36 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 78f9c9d..f09c0f6 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.3.0 + 3.5.3 package @@ -53,7 +53,7 @@ com.artillexstudios.axtrade.libs.gui - net.kyori.adventure + net.kyori com.artillexstudios.axtrade.libs.kyori @@ -109,8 +109,9 @@ com.artillexstudios.axapi axapi - 1.4.136 + 1.4.224 compile + all org.spigotmc @@ -127,7 +128,7 @@ me.clip placeholderapi - 2.11.3 + 2.11.5 provided @@ -136,6 +137,30 @@ 3.0.2 compile + + net.kyori + adventure-platform-bukkit + 4.3.2 + compile + + + net.kyori + adventure-text-minimessage + 4.16.0 + compile + + + net.kyori + adventure-text-serializer-legacy + 4.16.0 + compile + + + net.kyori + adventure-api + 4.16.0 + compile + me.aglerr.mobcoins diff --git a/src/main/java/com/artillexstudios/axtrade/trade/Trade.java b/src/main/java/com/artillexstudios/axtrade/trade/Trade.java index 3f5cbbc..d4618a7 100644 --- a/src/main/java/com/artillexstudios/axtrade/trade/Trade.java +++ b/src/main/java/com/artillexstudios/axtrade/trade/Trade.java @@ -26,6 +26,8 @@ public class Trade { this.player2 = new TradePlayer(this, p2); player1.setOtherPlayer(player2); player2.setOtherPlayer(player1); + + HistoryUtils.writeToHistory(String.format("Started: %s - %s", player1.getPlayer().getName(), player2.getPlayer().getName())); } public void update() { @@ -43,6 +45,7 @@ public class Trade { if (itemStack == null) return; player2.getPlayer().getInventory().addItem(itemStack); }); + HistoryUtils.writeToHistory(String.format("Aborted: %s - %s", player1.getPlayer().getName(), player2.getPlayer().getName())); MESSAGEUTILS.sendLang(player1.getPlayer(), "trade.aborted", Map.of("%player%", player2.getPlayer().getName())); MESSAGEUTILS.sendLang(player2.getPlayer(), "trade.aborted", Map.of("%player%", player1.getPlayer().getName())); SoundUtils.playSound(player1.getPlayer(), "aborted"); diff --git a/src/main/java/com/artillexstudios/axtrade/utils/ItemBuilderUtil.java b/src/main/java/com/artillexstudios/axtrade/utils/ItemBuilderUtil.java index 5a6cd1d..7a5dc47 100644 --- a/src/main/java/com/artillexstudios/axtrade/utils/ItemBuilderUtil.java +++ b/src/main/java/com/artillexstudios/axtrade/utils/ItemBuilderUtil.java @@ -23,14 +23,14 @@ public class ItemBuilderUtil { final ItemBuilder builder = new ItemBuilder(section); section.getOptionalString("name").ifPresent((name) -> { - if (ClassUtils.classExists("me.clip.placeholderapi.PlaceholderAPI")) { + if (ClassUtils.INSTANCE.classExists("me.clip.placeholderapi.PlaceholderAPI")) { name = me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(player, name); } builder.setName(name, replacements); }); section.getOptionalStringList("lore").ifPresent((lore) -> { - if (ClassUtils.classExists("me.clip.placeholderapi.PlaceholderAPI")) { + if (ClassUtils.INSTANCE.classExists("me.clip.placeholderapi.PlaceholderAPI")) { lore = me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(player, lore); } builder.setLore(lore, replacements); diff --git a/src/main/java/com/artillexstudios/axtrade/utils/ShulkerUtils.java b/src/main/java/com/artillexstudios/axtrade/utils/ShulkerUtils.java index 238036c..81c9c23 100644 --- a/src/main/java/com/artillexstudios/axtrade/utils/ShulkerUtils.java +++ b/src/main/java/com/artillexstudios/axtrade/utils/ShulkerUtils.java @@ -15,7 +15,7 @@ public class ShulkerUtils { final BlockStateMeta meta = (BlockStateMeta) item.getItemMeta(); if (meta.getBlockState() instanceof ShulkerBox) { final ShulkerBox shulker = (ShulkerBox) meta.getBlockState(); - if (ClassUtils.classExists("com.artillexstudios.axshulkers.utils.ShulkerUtils") && com.artillexstudios.axshulkers.utils.ShulkerUtils.getShulkerUUID(item) != null) { + if (ClassUtils.INSTANCE.classExists("com.artillexstudios.axshulkers.utils.ShulkerUtils") && com.artillexstudios.axshulkers.utils.ShulkerUtils.getShulkerUUID(item) != null) { return com.artillexstudios.axshulkers.AxShulkers.getDB().getShulker(com.artillexstudios.axshulkers.utils.ShulkerUtils.getShulkerUUID(item)); } return shulker.getInventory().getContents(); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 4dc3288..b896ea0 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -11,7 +11,7 @@ command-aliases: - "trade" # the time after clicking the trade confirm button before the trade finishes -trade-confirm-seconds: 10 +trade-confirm-seconds: 5 # how fast should trade requests expire? trade-request-expire-seconds: 60 diff --git a/src/main/resources/guis.yml b/src/main/resources/guis.yml index bb4a61a..71fa31d 100644 --- a/src/main/resources/guis.yml +++ b/src/main/resources/guis.yml @@ -60,7 +60,6 @@ own: - "�ffdd&l> �ffddClick &8- �ffddChange Amount" currency2: slot: 3 - # you need Vault installed for this currency: "Experience" material: "EXPERIENCE_BOTTLE" name: "�ffdd&lᴇxᴘᴇʀɪᴇɴᴄᴇ"