Forgero and Sinytra incompatible textures caused by offsets being ignored
Mod Name
Forgero
Mod Homepage
https://modrinth.com/mod/forgero
Minecraft version
1.20.1
Describe the bug
Offset values on textures dont seem to work.
Steps to reproduce
- Add Forgero
- Start game
- Use upgrade station to modify tools
- Certain layers/textures do not seem to respect their offset values defined in files resulting in weird offcentered textures.
Logs
https://mclo.gs/uofuxgc
Additional context
We want to have full compat with sinytra and forge. So getting some help on this would be great. Everything else seems to work great. We want to know if there is a reason for this on the sinytra side before we start adjusting our textures to fit.
Also keep in mind I have a modified version of forgero that doesnt crash on startup, the modrinth one does atm because of a reach mixin.
There is no log needed as this there are zero crashes so thats pointless.
Hi could you please send a screenshot of what the expected result is? I'll try to look into the issue
Hi, thanks for looking into the issue!
This is a screenshot with connector:
this is a screenshot on fabric:
Another example with connector:
The same on fabric:
The only difference between these textures is the offset we specify in the json files as following:
(a photo of the json for the binding texture, where the other tools that dont have offsets work fine)
(a photo of the json file for the gem, alot of offsets so the reason why this one is the most seen)
Hopefully we can find a solution for this. Again keep in mind the modrinth version doesnt currently run with sinytra. If you need the modified version (without our broken mixin nothing else) just say it and I can send it your way!
Hi! Mod author of Forgero here, just thought I would pop in and provide some context. That json follows a custom format that is specific for finding and correcting textures based on tools parts, it is only ever parsed and handled by my own code. So I would not spend a lot of time looking for issues in the json files.
Here is the code that is translating the offsets after the model has been built using an ItemModelGenerator that is building regular JsonUnbakedModel using a dynamically generated json formatted string. The goal is to dynamically build models on the fly based on the underlying structure of tools and parts. I would assume that if this approach could be problematic considering how Sinytra is interfacing with Forge, the issue might be in the translation somewhere, but if this should be fine, then the problem is very likely in my own code, and it is struggling to behave correctly in a Forge environment.
private void applyOffset(ModelElement element) {
for (ModelElementFace face : element.faces.values()) {
var offset = offsetMap.getOrDefault(face.textureId, new Offset(0, 0));
if (offset.x() != 0 || offset.y() != 0) {
element.from.add(offset.x(), offset.y(), 0);
element.to.add(offset.x(), offset.y(), 0);
break;
}
}
...
}
Awesome work on the Sinytra project btw! :star:
Any update on this? Otherwise I am gonna to start changing our offset textures, to make forgero more compatible with sinytra.