diff --git a/pom.xml b/pom.xml index 731354f..bde34a6 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.artillexstudios AxTrade - 1.1.0 + 1.1.1 jar AxTrade diff --git a/src/main/java/com/artillexstudios/axtrade/hooks/currency/PlaceholderCurrencyHook.java b/src/main/java/com/artillexstudios/axtrade/hooks/currency/PlaceholderCurrencyHook.java index 71adbc1..5d70156 100644 --- a/src/main/java/com/artillexstudios/axtrade/hooks/currency/PlaceholderCurrencyHook.java +++ b/src/main/java/com/artillexstudios/axtrade/hooks/currency/PlaceholderCurrencyHook.java @@ -53,7 +53,7 @@ public class PlaceholderCurrencyHook implements CurrencyHook { final OfflinePlayer pl = Bukkit.getOfflinePlayer(player); if (pl.getName() == null) return; final String placeholder = section.getString("settings.give-command") - .replace("%amount%", "" + amount) + .replace("%amount%", parseNumber(amount)) .replace("%player%", pl.getName()); Bukkit.dispatchCommand(Bukkit.getConsoleSender(), placeholder); } @@ -63,8 +63,12 @@ public class PlaceholderCurrencyHook implements CurrencyHook { final OfflinePlayer pl = Bukkit.getOfflinePlayer(player); if (pl.getName() == null) return; final String placeholder = section.getString("settings.take-command") - .replace("%amount%", "" + amount) + .replace("%amount%", parseNumber(amount)) .replace("%player%", pl.getName()); Bukkit.dispatchCommand(Bukkit.getConsoleSender(), placeholder); } + + private String parseNumber(double amount) { + return usesDouble() ? "" + amount : "" + Math.round(amount); + } } \ No newline at end of file diff --git a/src/main/java/com/artillexstudios/axtrade/listeners/PlayerInteractEntityListener.java b/src/main/java/com/artillexstudios/axtrade/listeners/PlayerInteractEntityListener.java index f305dd8..71ef90b 100644 --- a/src/main/java/com/artillexstudios/axtrade/listeners/PlayerInteractEntityListener.java +++ b/src/main/java/com/artillexstudios/axtrade/listeners/PlayerInteractEntityListener.java @@ -18,6 +18,7 @@ public class PlayerInteractEntityListener implements Listener { public void onClick(@NotNull PlayerInteractEntityEvent event) { if (!CONFIG.getBoolean("shift-click-send-request", true)) return; final Player player = event.getPlayer(); + if (!player.hasPermission("axtrade.trade")) return; if (cd.containsKey(player) && System.currentTimeMillis() - cd.get(player) < 100L) return;