SteamWar/BauSystem
Archiviert
13
0

ChaosBauGUI #183

Manuell gemergt
YoyoNow hat 20 Commits von ChaosBauGUI nach master 2021-02-24 19:16:17 +01:00 zusammengeführt
2 geänderte Dateien mit 9 neuen und 2 gelöschten Zeilen
Nur Änderungen aus Commit 0041088546 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -328,7 +328,7 @@ public class CommandGUI implements CommandExecutor, Listener {
private static void scriptBooksGUI(Player player) { private static void scriptBooksGUI(Player player) {
List<SWListInv.SWListEntry<ScriptBook>> entries = new ArrayList<>(); List<SWListInv.SWListEntry<ScriptBook>> entries = new ArrayList<>();
List<ScriptBook> books = ScriptBook.getBooks(); List<ScriptBook> 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<ScriptBook> inv = new SWListInv<>(player, "Script Bücher", entries, (clickType, scriptBook) -> { SWListInv<ScriptBook> inv = new SWListInv<>(player, "Script Bücher", entries, (clickType, scriptBook) -> {
player.closeInventory(); player.closeInventory();
player.getInventory().addItem(scriptBook.toItemStack()); player.getInventory().addItem(scriptBook.toItemStack());

Datei anzeigen

@ -40,11 +40,13 @@ public class ScriptBook {
} }
private List<String> lines; private List<String> lines;
private List<String> lore;
private String author; private String author;
private String name; private String name;
ScriptBook(ConfigurationSection section) { ScriptBook(ConfigurationSection section) {
this.lines = section.getStringList("lines"); this.lines = section.getStringList("lines");
this.lore = section.getStringList("lore");
this.author = section.getString("author", "§8Steam§eWar"); this.author = section.getString("author", "§8Steam§eWar");
this.name = section.getName(); this.name = section.getName();
} }
@ -57,6 +59,7 @@ public class ScriptBook {
meta.setTitle(name); meta.setTitle(name);
meta.setAuthor(author); meta.setAuthor(author);
meta.setGeneration(BookMeta.Generation.ORIGINAL); meta.setGeneration(BookMeta.Generation.ORIGINAL);
meta.setLore(lore);
book.setItemMeta(meta); book.setItemMeta(meta);
return book; return book;
} }
@ -77,6 +80,10 @@ public class ScriptBook {
return name; return name;
} }
public List<String> getLore() {
return lore;
}
private String[] getPages() { private String[] getPages() {
List<StringBuilder> pages = new ArrayList<>(); List<StringBuilder> pages = new ArrayList<>();
pages.add(0, new StringBuilder()); pages.add(0, new StringBuilder());