
[๐]: Colored placed books
donmor opened this issue ยท 17 comments
Books can be dyed with Scholar Mod installed, an RGB value is added to the book. It'll be good if book piles in this mod can read this value and render the books colored.
book piles are fully data driven now, they can do many things suck as support the book nbt. people can add new ones with datapack
I'm reading the source code these days. I can't find an implementation to display a color based off nbt or something (or I missed something... I know little datapack things)
I think an easy implementation is adding something like this to VisualBook
:
...
if (item instanceof BookItem) {
// add an if branch to handle this. the CompoundTag stuff is from https://github.com/mortuusars/Scholar/blob/1.20.1/common/src/main/java/io/github/mortuusars/scholar/book/BookColor.java
CompoundTag compoundTag;
if ((compoundTag = stack.getTagElement(TAG_DISPLAY)) != null && compoundTag.contains(TAG_COLOR, Tag.TAG_ANY_NUMERIC)) {
this.type = new BookType("dyed", compoundTag.getInt(TAG_COLOR), false);
}
...
}
...
I already have a data driven system that controls every aspect of the placed books. these already support item nbt. it would just be a matter of adding a resource pack file (BookModelVisuals is class thatdefines the codec)
and are you on fabric? because on forge book placement happens on the same level as block placement. for all except written ones that use the place event. Place event on forge has low priority so other mods one should take effect first. theres no such thing on fabric
So it washes them not colours them I see. I'll double check the event priority thing
I need to know because it might be 2 different issues. Can you wash a dyed one? Or just can't dye? Does throwing in the cauldron do anything?
Yeah so those are problematic. Both are using the event with same priority. I'll take care of it. This should work when washing and when using normal books. Confirm?
I'll have a look. When I get some time. Something is wrong in amendments code it seems. Post that video there pls i don't forget