ScriptSystemImprovements #209
@ -44,8 +44,9 @@ public class CommandScriptVars implements CommandExecutor {
|
||||
return false;
|
||||
}
|
||||
player.sendMessage(BauSystem.PREFIX + varName + "=" + globalVariables.get(varName));
|
||||
return false;
|
||||
}
|
||||
switch (args[2].toLowerCase()) {
|
||||
switch (args[1].toLowerCase()) {
|
||||
case "delete":
|
||||
case "clear":
|
||||
case "remove":
|
||||
@ -57,7 +58,7 @@ public class CommandScriptVars implements CommandExecutor {
|
||||
player.sendMessage(BauSystem.PREFIX + "Variable " + varName + " gelöscht");
|
||||
break;
|
||||
default:
|
||||
int value = ScriptListener.parseValue(args[2]);
|
||||
int value = ScriptListener.parseValue(args[1]);
|
||||
ScriptListener.GLOBAL_VARIABLES.computeIfAbsent(player, p -> new HashMap<>()).put(varName, value);
|
||||
player.sendMessage(BauSystem.PREFIX + varName + " auf " + value + " gesetzt");
|
||||
}
|
||||
|
@ -278,6 +278,9 @@ public class ScriptListener implements Listener {
|
||||
String s = String.join(" ", args);
|
||||
Set<String> variables = new HashSet<>(scriptExecutor.variables.keySet());
|
||||
variables.addAll(CONSTANTS.keySet());
|
||||
if (GLOBAL_VARIABLES.containsKey(scriptExecutor.player)) {
|
||||
variables.addAll(GLOBAL_VARIABLES.get(scriptExecutor.player).keySet());
|
||||
}
|
||||
for (String variable : variables) {
|
||||
s = s.replace("<" + variable + ">", getValue(scriptExecutor, variable) + "");
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren