A fix for heavy_core failing to get it's texture#62
Conversation
|
For reference: This is reported in MC-270059. |
Ah, so it has been known about for a while. I think it's reasonable to not want to add a work around for a Mojang bug so no hard feelings if that determination is made. But it's also been a problem for over year and there is no way to know when they will get around to fixing it. |
|
I've looked at the code. The I think we should handle it the same way. It should simplify this logic a bit. |
c49d314 to
72ad94b
Compare
|
I think this is what you meant but I am not 100% sure so let me know if you had something else in mind. I changed it to always assume it's getting handed a key and then only go into the while loop if gets returned another variable("#") from that initial lookup. This does catch the wrong heavy_core model and it also gets rid of the extra lookups that my first version was doing. Sorry for the git nonsense I am a bumbling fool. |
Before:


After:
Currently the heavy_core model is falling back to the texture at 0, 0 on the texture atlas because it's trying to use "all" as a texture and that doesn't exist. The heavy core's block model has it's face's textures defined like
"texture": "all"but they should be defined like"texture": "#all". Without a '#' getTexture will skip the texture lookup for heavy_core.I am not sure this is the best approach to solve this so let me know if you have a better idea. Added an extra check to make sure the textureRef string doesn't exist in this.textures before returning it. I put a cap of 7 on the loop out of an abundance of caution but it rarely reaches 3. The other option I thought of would just be an explicit if === 'all' check to only catch this one case.
If Mojang fixes how they define the heavy_core model this would be unnecessary but as far as I can tell this is how they have defined it since they added the block.