Elborshooter Posted Wednesday at 05:18 PM Report Posted Wednesday at 05:18 PM Game version : 1.21.6 Alright, first of all, I'm a bad programmer that don't know a lot of C#, so most of what I've done so far has been vibe coded with chatgpt (with all the pain that comes from it, like how it kept telling me that what I wanted to do was possible in the newer 1.22+ versions, but not in the old 1.21.6...), don't really like doing that but my adhd would have killed me... With that out of the way, I've been making a mod that allows making clay tablets on which you can write cuneiform strokes however you please. All the logic is pretty much done with the content of the tablet being saved in a TreeAttributes as bytes containing the x,y position (relative to the tablet interface), the length, the angle and the type of stroke. That part is working fine so my question now is whether it could be possible to render those strokes as a texture overlay directly onto the tablet item itself, so that it would be visible even outside of the GUI. I thought about adding alternate temporary textures that could be written over, but that would mean a very limited amount of different tablets at a time, and instead I find a way to generate a new texture for every new tablet, that would mean potential infinite bloat. So instead I'm wondering if it's possible to sort of hack into the rendering method of the textures to add an overlay that would take the same parameters as my treeAttributes, in which case the rendering logic I have for the GUI should be easily re-used (I think...) So that's the question, I hope I'm not being too vague or, more likely, too ambitious...
Elborshooter Posted Saturday at 09:14 AM Author Report Posted Saturday at 09:14 AM Alright, I figured it out for the most part by using the OnBeforeRender method. I do have an annoying issue though. The overlay with the strokes renders nicely and is visible both while in my hand or on the ground, but it disappears if there's an item (not a block) in my offhand, or my main hand when the tablet is on the ground, that does not have the Attribute containing the strokes, that includes another tablet that has never been edited, but as soon as it gets edited the overlay works. With another edited tablet With a never edited tablet Any help would be greatly appreciated
Recommended Posts