hydrogen-fabric icon indicating copy to clipboard operation
hydrogen-fabric copied to clipboard

Referance equality problem

Open alphaqu opened this issue 2 years ago • 5 comments

The reference equality issue has not been solved fully as the HydrogenImmutableReferenceHashMap still enforces it. This breaks DashLoader and should prob be fixed by using .equals instead of ``==` in the HydrogenImmutableReferenceHashMap.

alphaqu avatar Jul 09 '21 13:07 alphaqu

The point of a reference hash map (rather than an object hash map) is not to use .equals since == is significantly faster (a single integer comparison rather than a method call).

How does DashLoader break this assumption exactly?

magneticflux- avatar Jul 09 '21 19:07 magneticflux-

Dashloader does not get properties like mc does it as it creates new objects for them. And because of this hydrogen cannot return any properties as they are not the same object

alphaqu avatar Jul 10 '21 07:07 alphaqu

It sounds like an issue that needs to be fixed on DashLoader's end. I recommend trying to inject earlier and trying to make it compatible with https://github.com/CaffeineMC/hydrogen-fabric/pull/22

magneticflux- avatar Jul 10 '21 07:07 magneticflux-

that has been partly fixed in https://github.com/CaffeineMC/hydrogen-fabric/commit/b691a6892f17a5f93aa8fb1f8f0605a036138ce8 but not fully

alphaqu avatar Jul 10 '21 08:07 alphaqu

DashLoader cant fix this. Its not a normal mod. It recreates the other mods assets

alphaqu avatar Jul 10 '21 08:07 alphaqu