From cdc692d6d29395e3114ffc4011d6d3888f9566c5 Mon Sep 17 00:00:00 2001 From: SarTron-NorthBlue Date: Sat, 25 Jul 2026 17:23:46 +0400 Subject: [PATCH] Fix : %player% jamais remplace dans les commandes VoteParty Les commandes voteparty.commands s'executaient une seule fois cote console sans substitution de %player%, ce qui envoyait le placeholder brut aux plugins de recompense (ex. "excellentcrates key give %player% epic 5" -> "Joueur introuvable"). Les commandes contenant %player% sont maintenant executees une fois par joueur en ligne ; les commandes sans placeholder (deja globales, ex. "goldencrates broadcast_give ...") gardent leur comportement precedent. Co-Authored-By: Claude Sonnet 5 --- .../fr/votenetwork/spigot/voteparty/VoteParty.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/spigot/src/main/java/fr/votenetwork/spigot/voteparty/VoteParty.java b/spigot/src/main/java/fr/votenetwork/spigot/voteparty/VoteParty.java index 7b0a7c4..69004ce 100644 --- a/spigot/src/main/java/fr/votenetwork/spigot/voteparty/VoteParty.java +++ b/spigot/src/main/java/fr/votenetwork/spigot/voteparty/VoteParty.java @@ -62,12 +62,23 @@ public class VoteParty { save(); } + /** + * Commands without %player% run once (e.g. a crate plugin's own "give to everyone" + * command). Commands containing %player% are dispatched once per online player, since + * VoteParty rewards the whole server rather than a single voter. + */ private void trigger() { if (config.isVotePartyBroadcastEnabled()) { Bukkit.broadcastMessage(config.getVotePartyTriggeredMessage()); } for (String command : config.getVotePartyCommands()) { - Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command); + if (command.contains("%player%")) { + for (org.bukkit.entity.Player player : Bukkit.getOnlinePlayers()) { + Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command.replace("%player%", player.getName())); + } + } else { + Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command); + } } }