Sodium Reloaded (Unofficial)

Sodium Reloaded (Unofficial)

0 Downloads

`WorldSlice#getColor` cannot be called with custom ColorResolvers

embeddedt opened this issue ยท 1 comments

commented

Request Description

In Sodium 0.5+, WorldSlice#getColor converts to a BiomeColorSource internally before retrieving the color, and BiomeColorSource is an enum that only supports GRASS, WATER, and FOLIAGE. Therefore, there is no way to pass a custom ColorResolver and have it work correctly with Sodium 0.5+. An example of a crash this causes (albeit with a Forge mod) can be found here.

I think the best way to solve this issue is to remove the enum, and refactor BiomeColorCache to look up the appropriate ColorBuffer based on the provided ColorResolver instance. If this solution sounds reasonable, I am willing to make a PR.

commented

For what it is worth, it isn't actually possible to use a custom ColorResolver in Minecraft without additional mixins. So this would be enabling functionality that isn't normally available.