ItemBook.java 文件源码

java
阅读 19 收藏 0 点赞 0 评论 0

项目:Kineticraft 作者:
@Override
public void updateItem() {

    if (getTitle() != null)
        getMeta().setTitle(getTitle());
    if (getAuthor() != null)
        getMeta().setAuthor(getAuthor());

    getMeta().setPages(new ArrayList<>()); // A book needs its page tag, so we'll default to an empty one.
    if (isWriteLines())// Save the book pages to the item.
        getMeta().pages.addAll(getPages().stream().map(TextBuilder::create)
                .map(TextUtils::toNMSComponent).collect(Collectors.toList()));

    if (getMeta().pages.isEmpty()) // Allow the book to be opened / editted.
        getMeta().addPage("");

    getMeta().setGeneration(BookMeta.Generation.TATTERED);
    this.page = 0; // Reset writer.
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号