Update BookBuilder
This commit is contained in:
parent
e685221014
commit
6f63102ec5
@ -80,6 +80,7 @@ public class TInjectLoader implements TabooLibLoader.Loader {
|
||||
config.listener(() -> {
|
||||
try {
|
||||
method.invoke(instance);
|
||||
} catch (NullPointerException ignored) {
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
|
@ -1,7 +1,9 @@
|
||||
package io.izzel.taboolib.util.book.builder;
|
||||
|
||||
import io.izzel.taboolib.module.tellraw.TellrawJson;
|
||||
import io.izzel.taboolib.util.book.BookAsm;
|
||||
import io.izzel.taboolib.util.chat.BaseComponent;
|
||||
import io.izzel.taboolib.util.chat.ComponentSerializer;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.BookMeta;
|
||||
|
||||
@ -106,6 +108,11 @@ public class BookBuilder {
|
||||
BookAsm.getHandle().setPages(meta, pages.toArray(new BaseComponent[0][]));
|
||||
return this;
|
||||
}
|
||||
|
||||
public BookBuilder addPage(TellrawJson json) {
|
||||
addPages(ComponentSerializer.parse(json.toRawMessage()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append the pages of the book
|
||||
|
Loading…
Reference in New Issue
Block a user