Closed fayer3 closed 1 month ago
FerriteCore does not use a Reference2ObjectArrayMap
to back blockstates, because it has very bad memory complexity as the number of states increases. This is accomplished by using ASM to widen the private values
field type to Reference2ObjectMap
. 99.9% of mods are not affected by this because the public getValues
method already uses the more generic Reference2ObjectMap
, and it returns the map directly, meaning no one else has a reason to AT the private field.
This creates a problem for you because you are no longer able to pass the return value of getValues()
back into the constructor for another state object. I think your options are:
Reference2ObjectArrayMap
yourself, instead of assuming the return type is one.null
to the super constructor and then use reflection to set the values
field to the return value of getValues()
(this will succeed with or without FC).FluidState
s at all, it's rather hacky. :stuck_out_tongue: I would go with the first option because it doesn't look like this wrapper is used outside a very specific menu renderer and the fluid state values map shouldn't have enough properties that the performance of copying becomes a concern.
The FluidState wrapper is necessary since certain checks for fluid types are tied to tags which aren't defined when a world isn't loaded. The renderer will not handle water/lava correctly if these checks don't return a correct result.
fixed with ab0eed7
maybe I did something wrong here https://github.com/Vivecraft/VivecraftMod/blob/89e799195ea9b197a00a0a780fc98fff39b0b199/common/src/main/java/org/vivecraft/client_vr/menuworlds/MenuWorldRenderer.java#L1781