You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the code tries to get a block state for each of the possible meta combinations. This leads to more lookups than necessary and is a big contributor to the exceptions you have to catch. You can use block.getBlockState().getValidStates() to get an immutable list of all valid states. In the tests I ran, this lead to an increase in load times. This increase was slight in vanilla, but more noticeable in heavily modded environments.
The text was updated successfully, but these errors were encountered:
You could further optimize this code by replacing the code used to check for duplicate sprites. You currently compare all four UV coordinates, however you only need to compare U1 and V2 to get the same results.
If you wanted to further improve this code, you could map TextureAtlasSprite objects to their colour, and then use this result instead. In my basic tests the speed is roughly the same, but results in more sprites being skipped. This would likely have the biggest impact with higher res textures.
Currently the code tries to get a block state for each of the possible meta combinations. This leads to more lookups than necessary and is a big contributor to the exceptions you have to catch. You can use
block.getBlockState().getValidStates()
to get an immutable list of all valid states. In the tests I ran, this lead to an increase in load times. This increase was slight in vanilla, but more noticeable in heavily modded environments.The text was updated successfully, but these errors were encountered: