Script System Lua #178
@ -58,7 +58,7 @@ public class ScriptGUI implements Listener {
|
||||
|
||||
Script.list(user).forEach(script -> {
|
||||
try {
|
||||
globals.load(script.getScript()).call();
|
||||
globals.load(script.getCode()).call();
|
||||
} catch (Exception e) {
|
||||
String[] sp = e.getMessage().split(":");
|
||||
lore.add(BauSystem.MESSAGE.parse("SCRIPT_ERROR_GUI", player, String.join(":", Arrays.copyOfRange(sp, 1, sp.length))));
|
||||
|
@ -38,7 +38,7 @@ public class ScriptHelper {
|
||||
BookMeta meta = (BookMeta) itemStack.getItemMeta();
|
||||
if(!writeable) {
|
||||
meta.setTitle(script.getName());
|
||||
meta.setAuthor(SteamwarUser.get(script.getUser()).getUserName());
|
||||
meta.setAuthor(SteamwarUser.get(script.getUserId()).getUserName());
|
||||
}
|
||||
meta.setPages(getScriptPages(script));
|
||||
itemStack.setItemMeta(meta);
|
||||
@ -46,7 +46,7 @@ public class ScriptHelper {
|
||||
}
|
||||
|
||||
public static List<String> getScriptPages(Script script) {
|
||||
return Arrays.stream(script.getScript().split(PAGE_SEPARATOR)).collect(Collectors.toList());
|
||||
return Arrays.stream(script.getCode().split(PAGE_SEPARATOR)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static String getScriptString(List<String> pages) {
|
||||
|
@ -61,7 +61,7 @@ public class ScriptRunner {
|
||||
|
||||
public static void updateGlobalScript(Player player) {
|
||||
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
|
||||
ScriptRunner.createGlobalScript(Script.list(user).stream().map(Script::getScript).collect(Collectors.toList()), player);
|
||||
ScriptRunner.createGlobalScript(Script.list(user).stream().map(Script::getCode).collect(Collectors.toList()), player);
|
||||
}
|
||||
|
||||
public static void createGlobalScript(List<String> scripts, Player player) {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren