Signed-off-by: Chaoscaot <chaoscaot@zohomail.eu>
Dieser Commit ist enthalten in:
Ursprung
9598838d2e
Commit
586e94d50a
@ -112,7 +112,12 @@ public class ScriptRunner {
|
||||
});
|
||||
|
||||
for (LuaFunction luaFunction : luaFunctions) {
|
||||
try {
|
||||
luaFunction.call(eventValue);
|
||||
} catch (Exception e) {
|
||||
String[] sp = e.getMessage().split(":");
|
||||
BauSystem.MESSAGE.send("SCRIPT_ERROR_GLOBAL", player, String.join(":", Arrays.copyOfRange(sp, 1, sp.length)));
|
||||
}
|
||||
}
|
||||
|
||||
return cancelled.get();
|
||||
@ -124,12 +129,22 @@ public class ScriptRunner {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
commandRegister.getFunction().call(args);
|
||||
} catch (Exception e) {
|
||||
String[] sp = e.getMessage().split(":");
|
||||
BauSystem.MESSAGE.send("SCRIPT_ERROR_GLOBAL", player, String.join(":", Arrays.copyOfRange(sp, 1, sp.length)));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void callHotkey(int mods, int key, Player player, boolean pressed) {
|
||||
Hotkey hotkey = Hotkey.fromChar(key, mods);
|
||||
try {
|
||||
HOTKEY_MAP.getOrDefault(player, Collections.emptyMap()).getOrDefault(hotkey, Collections.emptyList()).forEach(luaFunction -> luaFunction.call(LuaValue.valueOf(pressed)));
|
||||
} catch (Exception e) {
|
||||
String[] sp = e.getMessage().split(":");
|
||||
BauSystem.MESSAGE.send("SCRIPT_ERROR_GLOBAL", player, String.join(":", Arrays.copyOfRange(sp, 1, sp.length)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren