#1026 Add more tags for forced commands (lazily replaced) (#214)

* #1026 Add more tags for forced commands (lazily replaced)
- Extract lazy replacement of tags to its own class
- Implement wrapper to replace a String property within an object
  - Use wrapper in command manager and add new tags

* Make argument type generic in lazy tags util
This commit is contained in:
ljacqu
2017-01-29 13:54:37 +01:00
committed by Gabriele C
parent 7578247085
commit 89c70ff447
12 changed files with 329 additions and 189 deletions
@@ -26,7 +26,7 @@ public class GenerateCommandsYml implements AutoToolTask {
// Get default and add sample entry
CommandConfig commandConfig = CommandSettingsHolder.COMMANDS.getDefaultValue();
commandConfig.setOnLogin(
ImmutableMap.of("welcome", newCommand("msg %p Welcome back!", Executor.PLAYER)));
ImmutableMap.of("welcome", new Command("msg %p Welcome back!", Executor.PLAYER)));
// Export the value to the file
SettingsManager settingsManager = new SettingsManager(
@@ -41,11 +41,4 @@ public class GenerateCommandsYml implements AutoToolTask {
public String getTaskName() {
return "generateCommandsYml";
}
private static Command newCommand(String commandLine, Executor executor) {
Command command = new Command();
command.setCommand(commandLine);
command.setExecutor(executor);
return command;
}
}