SteamWar/BauSystem2.0
Archiviert
12
0

Merge remote-tracking branch 'origin/master'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-07-17 17:24:42 +02:00
Commit b93c743969
3 geänderte Dateien mit 12 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -233,6 +233,7 @@ GUI_EDITOR_TITLE_MORE=Select item
SCRIPT_ERROR_GUI=§cError in parsing script: Line {0} SCRIPT_ERROR_GUI=§cError in parsing script: Line {0}
SCRIPT_ERROR_GLOBAL=§cError in global script: Line {0} SCRIPT_ERROR_GLOBAL=§cError in global script: Line {0}
SCRIPT_ERROR_CLICK=§cError in script: Line {0} SCRIPT_ERROR_CLICK=§cError in script: Line {0}
SCRIPT_ERROR_ONLY_IN_GLOBAL=§cThis function is only available in global scripts
## CustomScript ## CustomScript
SCRIPT_HOTKEY_ITEM_NAME = §7Hotkey§8: §e{0} SCRIPT_HOTKEY_ITEM_NAME = §7Hotkey§8: §e{0}

Datei anzeigen

@ -230,6 +230,7 @@ GUI_EDITOR_TITLE_MORE=Item auswählen
SCRIPT_HOTKEY_ITEM_NAME = §7Hotkey§8: §e{0} SCRIPT_HOTKEY_ITEM_NAME = §7Hotkey§8: §e{0}
SCRIPT_EVENT_ITEM_NAME = §7Event§8: §e{0} SCRIPT_EVENT_ITEM_NAME = §7Event§8: §e{0}
SCRIPT_COMMAND_ITEM_NAME = §7Befehl§8: §e/{0} SCRIPT_COMMAND_ITEM_NAME = §7Befehl§8: §e/{0}
SCRIPT_ERROR_ONLY_IN_GLOBAL=§cDieses Skript kann nur als globales Skript ausgeführt werden
## Script Menu GUI ## Script Menu GUI
SCRIPT_MENU_GUI_ITEM_LORE_1 = §7Klicke zum rausnehmen SCRIPT_MENU_GUI_ITEM_LORE_1 = §7Klicke zum rausnehmen

Datei anzeigen

@ -19,9 +19,11 @@
package de.steamwar.bausystem.features.script.lua; package de.steamwar.bausystem.features.script.lua;
import de.steamwar.bausystem.BauSystem;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.luaj.vm2.Globals; import org.luaj.vm2.Globals;
import org.luaj.vm2.LoadState; import org.luaj.vm2.LoadState;
import org.luaj.vm2.LuaError;
import org.luaj.vm2.LuaFunction; import org.luaj.vm2.LuaFunction;
import org.luaj.vm2.compiler.LuaC; import org.luaj.vm2.compiler.LuaC;
import org.luaj.vm2.lib.Bit32Lib; import org.luaj.vm2.lib.Bit32Lib;
@ -46,6 +48,14 @@ public class SteamWarPlatform {
globals.load(new StringLib()); globals.load(new StringLib());
globals.load(new SteamWarLuaPlugin(player)); globals.load(new SteamWarLuaPlugin(player));
globals.load(new SteamWarGlobalLuaPlugin((eventType, luaFunction) -> {
throw new LuaError(BauSystem.MESSAGE.parse("SCRIPT_ERROR_ONLY_IN_GLOBAL", player));
}, (s, luaFunction) -> {
throw new LuaError(BauSystem.MESSAGE.parse("SCRIPT_ERROR_ONLY_IN_GLOBAL", player));
}, commandRegister -> {
throw new LuaError(BauSystem.MESSAGE.parse("SCRIPT_ERROR_ONLY_IN_GLOBAL", player));
}));
LoadState.install(globals); LoadState.install(globals);
LuaC.install(globals); LuaC.install(globals);
return globals; return globals;