use of ivorius.reccomplex.random.Poem in project RecurrentComplex by Ivorforce.
the class Book method poem.
public static ItemStack poem(Random random) {
ItemStack stack = new ItemStack(Items.WRITTEN_BOOK);
Person author = Person.randomHuman(random, random.nextFloat() < 0.9f);
Poem poem = Poem.randomPoem(random, 32, author);
stack.setTagInfo("pages", NBTTagLists.write(bookPages(poem.getText()).stream().map(Book::toJSON).map(NBTTagString::new).collect(Collectors.toList())));
stack.setTagInfo("author", new NBTTagString(author.getFullName()));
stack.setTagInfo("title", new NBTTagString(poem.getTitle()));
return stack;
}
Aggregations