mirror of
https://github.com/NLthijs48/AreaShop.git
synced 2024-11-23 02:35:25 +01:00
Fixes a problem with the %clicker% tag for use with sign commands
With the previous implementation it would only get replaced for commands executed as the player, but executing as player is not wanted because then the player should have permission for that (example: /tellraw). Now it will properly get replaced for console and player commands attached to a state of the sign.
This commit is contained in:
parent
09af826f88
commit
ed1f73fdd7
@ -1922,12 +1922,18 @@ public abstract class GeneralRegion {
|
||||
}
|
||||
// Run player commands if specified
|
||||
String playerPath = "signProfiles." + profile + "." + getState().getValue().toLowerCase() + "." + clickType.getValue() + "Player";
|
||||
List<String> playerCommands = plugin.getConfig().getStringList(playerPath);
|
||||
List<String> playerCommands = new ArrayList<String>();
|
||||
for(String command : plugin.getConfig().getStringList(playerPath)) {
|
||||
playerCommands.add(command.replace(AreaShop.tagClicker, clicker.getName()));
|
||||
}
|
||||
runCommands(clicker, playerCommands);
|
||||
|
||||
// Run console commands if specified
|
||||
String consolePath = "signProfiles." + profile + "." + getState().getValue().toLowerCase() + "." + clickType.getValue() + "Console";
|
||||
List<String> consoleCommands = plugin.getConfig().getStringList(consolePath);
|
||||
List<String> consoleCommands = new ArrayList<String>();
|
||||
for(String command : plugin.getConfig().getStringList(consolePath)) {
|
||||
consoleCommands.add(command.replace(AreaShop.tagClicker, clicker.getName()));
|
||||
}
|
||||
runCommands(Bukkit.getConsoleSender(), consoleCommands);
|
||||
|
||||
return !playerCommands.isEmpty() || !consoleCommands.isEmpty();
|
||||
|
Loading…
Reference in New Issue
Block a user