Sodium Reloaded (Unofficial)

Sodium Reloaded (Unofficial)

0 Downloads

API for replacing rendered blockstates on chunk build

enjarai opened this issue ยท 1 comments

commented

Request Description

I've recently been working on a mod that has a feature that lets users disguise any block in the world as another block visually. When implementing this, it required me to make a mixin into Sodium for compatibility with its rendering, as is to be expected.

This has however been completely broken by sodium 0.6.0, and, since your update post mentioned you plan to implement new APIs for mod developers, I thought I'd raise my issue here. Concretely, I'd like an event that I can add a listener to which receives a specific position and world or chunk instance, and uses it to modify the blockstate rendered at that position.

If this is too niche a usecase to make an API for, I at least hope you'll be able to point me to the right place to move my mixin to. Thanks for your consideration.

commented

A mod that I'm a member of, Splatcraft, can also benefit from this API when we upgrade to 1.21+. One of the mechanics is being able to ink any block in the world, and inked blocks retain all of their usual properties. When a block is inked, we want to replace its texture with our own inked block texture with the ink's color. Ink can also be either "glowing" (a different texture + it emits light) and "clear" (the original texture is tinted to the ink's color)

I would want the API to provide a Level/Chunk + BlockPos (as outlined in OP's comment) and in addition be able to accept changes to the texture and color (we can't put all of our ink type + color combinations in BlockStates, as ink colors can be any hex colors). If a separate issue is needed for this usecase, let me know.