Supplementaries

Supplementaries

127M Downloads

[๐Ÿ—ƒ]: Colored placed books

donmor opened this issue ยท 17 comments

commented

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.

commented

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

commented

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)

commented

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);
    }
...
}
...
commented

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)

commented

does scholar add dye cauldron?

commented

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

commented

yes but im still confused. how can a cauldron that has water dye stuff?

commented

and are they normal books or written books?

commented

That's not a vanilla feature. Which mod adds it?

commented

Yeah I don't see anything relate do cauldron there

commented

So it washes them not colours them I see. I'll double check the event priority thing

commented

How do you colour tho?

commented

Also you didn't say if it's for books or written books

commented

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?

commented

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?

commented

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

commented

moved the videos to amendments and deleting them from here as not to clutter this issue with unrelated items