This commit is contained in:
BenceX100 2024-05-21 12:52:53 +02:00
parent bd508c1d5e
commit f66d9edad3
3 changed files with 8 additions and 3 deletions

View File

@ -6,7 +6,7 @@
<groupId>com.artillexstudios</groupId>
<artifactId>AxTrade</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>
<packaging>jar</packaging>
<name>AxTrade</name>

View File

@ -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);
}
}

View File

@ -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;