SteamWar/BauSystem2.0
Archiviert
12
0

Fixing...
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Chaoscaot <chaoscaot@zohomail.eu>
Dieser Commit ist enthalten in:
Chaoscaot 2023-07-01 13:40:52 +02:00
Ursprung ce389ca881
Commit 706eb17362
3 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -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))));

Datei anzeigen

@ -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) {

Datei anzeigen

@ -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) {