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