mirror of
https://github.com/cnaude/PurpleIRC-spigot.git
synced 2024-11-29 05:26:19 +01:00
Add %ARGX% tokens for game_command where X is any number.
This commit is contained in:
parent
0ae7cc9027
commit
5b631cd60a
@ -184,6 +184,15 @@ public class IRCMessageHandler {
|
|||||||
if (gameCommand.contains("%ARGS%")) {
|
if (gameCommand.contains("%ARGS%")) {
|
||||||
gameCommand = gameCommand.replace("%ARGS%", commandArgs);
|
gameCommand = gameCommand.replace("%ARGS%", commandArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gameCommand.matches(".*%ARG\\d+%.*")) {
|
||||||
|
String commandArgsArray[] = commandArgs.split(" ");
|
||||||
|
for (int i = 0; i < commandArgsArray.length; i ++) {
|
||||||
|
gameCommand = gameCommand.replace("%ARG" + (i + 1) + "%", commandArgsArray[i]);
|
||||||
|
}
|
||||||
|
gameCommand = gameCommand.replaceAll("%ARG\\d+%", "");
|
||||||
|
}
|
||||||
|
|
||||||
if (gameCommand.contains("%NAME%")) {
|
if (gameCommand.contains("%NAME%")) {
|
||||||
gameCommand = gameCommand.replace("%NAME%", user.getNick());
|
gameCommand = gameCommand.replace("%NAME%", user.getNick());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user