From 43cecb54e3b65e9870969e391411700704f8c97f Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 28 May 2023 00:59:06 +0200 Subject: [PATCH] Add WorldEditLib and Script Preview Signed-off-by: Chaoscaot --- BauSystem_Main/src/BauSystem.properties | 1 + BauSystem_Main/src/BauSystem_de.properties | 1 + .../bausystem/features/script/ScriptGUI.java | 7 +- .../script/lua/libs/WorldEditLib.java | 71 +++++++++++++++++++ .../src/de/steamwar/sql/Script.java | 1 + SCRIPT.md | 8 ++- 6 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 BauSystem_Main/src/de/steamwar/bausystem/features/script/lua/libs/WorldEditLib.java diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index 47fedf61..cd5a8b5d 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -246,6 +246,7 @@ SCRIPT_COMMAND_ITEM_NAME = §7Command§8: §e/{0} SCRIPT_MENU_GUI_ITEM_LORE_1 = §7Click to retrieve SCRIPT_MENU_GUI_ITEM_LORE_2 = §7Shift-Click to copy SCRIPT_MENU_GUI_ITEM_LORE_3 = §7Right-Click to edit +SCRIPT_MENU_GUI_ITEM_LORE_4 = §7Middle-Click to preview SCRIPT_MENU_GUI_NAME = §eScript-Menu SCRIPT_MENU_GUI_ITEM_ADD_NAME = §eInsert SCRIPT_MENU_GUI_ITEM_ADD_LORE = §7Click with a book to insert diff --git a/BauSystem_Main/src/BauSystem_de.properties b/BauSystem_Main/src/BauSystem_de.properties index 50f587a4..1af791cd 100644 --- a/BauSystem_Main/src/BauSystem_de.properties +++ b/BauSystem_Main/src/BauSystem_de.properties @@ -238,6 +238,7 @@ SCRIPT_COMMAND_ITEM_NAME = §7Command§8: §e/{0} SCRIPT_MENU_GUI_ITEM_LORE_1 = §7Klicke zum rausnehmen SCRIPT_MENU_GUI_ITEM_LORE_2 = §7Shift Klicke zum kopieren SCRIPT_MENU_GUI_ITEM_LORE_3 = §7Rechts Klicke zum editieren +SCRIPT_MENU_GUI_ITEM_LORE_4 = §7Mittel Klicke zum anschauen SCRIPT_MENU_GUI_NAME = §eScript-Menü SCRIPT_MENU_GUI_ITEM_ADD_NAME = §eHinzufügen SCRIPT_MENU_GUI_ITEM_ADD_LORE = §7Klicke mit einem Buch zum hinzufügen diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptGUI.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptGUI.java index 720feb78..c8de5eff 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptGUI.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptGUI.java @@ -30,6 +30,7 @@ import de.steamwar.sql.SteamwarUser; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.Listener; +import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.BookMeta; import org.luaj.vm2.Globals; @@ -69,6 +70,7 @@ public class ScriptGUI implements Listener { lore.add(BauSystem.MESSAGE.parse("SCRIPT_MENU_GUI_ITEM_LORE_1", player)); lore.add(BauSystem.MESSAGE.parse("SCRIPT_MENU_GUI_ITEM_LORE_2", player)); lore.add(BauSystem.MESSAGE.parse("SCRIPT_MENU_GUI_ITEM_LORE_3", player)); + lore.add(BauSystem.MESSAGE.parse("SCRIPT_MENU_GUI_ITEM_LORE_4", player)); entries.add(new SWListInv.SWListEntry<>(new SWItem(Material.ENCHANTED_BOOK, script.getName(), new ArrayList<>(lore), false, clickType -> {}), script)); lore.clear(); @@ -76,7 +78,10 @@ public class ScriptGUI implements Listener { SWListInv