diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGUI.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGUI.java index 23ff0f4..5f16601 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGUI.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGUI.java @@ -328,7 +328,7 @@ public class CommandGUI implements CommandExecutor, Listener { private static void scriptBooksGUI(Player player) { List> entries = new ArrayList<>(); List books = ScriptBook.getBooks(); - books.forEach(scriptBook -> entries.add(new SWListInv.SWListEntry<>(new SWItem(scriptBook.getBookMat(), scriptBook.getName()), scriptBook))); + books.forEach(scriptBook -> entries.add(new SWListInv.SWListEntry<>(new SWItem(scriptBook.getBookMat(), scriptBook.getName(), scriptBook.getLore(), false, clickType -> {}), scriptBook))); SWListInv inv = new SWListInv<>(player, "Script Bücher", entries, (clickType, scriptBook) -> { player.closeInventory(); player.getInventory().addItem(scriptBook.toItemStack()); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/ScriptBook.java b/BauSystem_Main/src/de/steamwar/bausystem/world/ScriptBook.java index abbac5c..cc1d03d 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/ScriptBook.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/ScriptBook.java @@ -39,12 +39,14 @@ public class ScriptBook { return configuration.getKeys(false).size(); } - private List lines; + private List lines; + private List lore; private String author; private String name; ScriptBook(ConfigurationSection section) { this.lines = section.getStringList("lines"); + this.lore = section.getStringList("lore"); this.author = section.getString("author", "§8Steam§eWar"); this.name = section.getName(); } @@ -57,6 +59,7 @@ public class ScriptBook { meta.setTitle(name); meta.setAuthor(author); meta.setGeneration(BookMeta.Generation.ORIGINAL); + meta.setLore(lore); book.setItemMeta(meta); return book; } @@ -77,6 +80,10 @@ public class ScriptBook { return name; } + public List getLore() { + return lore; + } + private String[] getPages() { List pages = new ArrayList<>(); pages.add(0, new StringBuilder());