Signed-off-by: Chaoscaot <chaoscaot@zohomail.eu>
Dieser Commit ist enthalten in:
Ursprung
ce389ca881
Commit
706eb17362
@ -58,7 +58,7 @@ public class ScriptGUI implements Listener {
|
|||||||
|
|
||||||
Script.list(user).forEach(script -> {
|
Script.list(user).forEach(script -> {
|
||||||
try {
|
try {
|
||||||
globals.load(script.getScript()).call();
|
globals.load(script.getCode()).call();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String[] sp = e.getMessage().split(":");
|
String[] sp = e.getMessage().split(":");
|
||||||
lore.add(BauSystem.MESSAGE.parse("SCRIPT_ERROR_GUI", player, String.join(":", Arrays.copyOfRange(sp, 1, sp.length))));
|
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();
|
BookMeta meta = (BookMeta) itemStack.getItemMeta();
|
||||||
if(!writeable) {
|
if(!writeable) {
|
||||||
meta.setTitle(script.getName());
|
meta.setTitle(script.getName());
|
||||||
meta.setAuthor(SteamwarUser.get(script.getUser()).getUserName());
|
meta.setAuthor(SteamwarUser.get(script.getUserId()).getUserName());
|
||||||
}
|
}
|
||||||
meta.setPages(getScriptPages(script));
|
meta.setPages(getScriptPages(script));
|
||||||
itemStack.setItemMeta(meta);
|
itemStack.setItemMeta(meta);
|
||||||
@ -46,7 +46,7 @@ public class ScriptHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static List<String> getScriptPages(Script script) {
|
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) {
|
public static String getScriptString(List<String> pages) {
|
||||||
|
@ -61,7 +61,7 @@ public class ScriptRunner {
|
|||||||
|
|
||||||
public static void updateGlobalScript(Player player) {
|
public static void updateGlobalScript(Player player) {
|
||||||
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
|
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) {
|
public static void createGlobalScript(List<String> scripts, Player player) {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren