Registrate icon indicating copy to clipboard operation
Registrate copied to clipboard

Messed up order of items due to HashBasedTable and identical ID for different registration types

Open lcy0x1 opened this issue 2 years ago • 2 comments

private final Table<String, ResourceKey<? extends Registry<?>>, Registration<?, ?>> registrations = HashBasedTable.create();

This line in abstract registry messed up the registration order of items if another type of registration happens before item and has the same name for some of the entries as the items

lcy0x1 avatar Oct 23 '22 06:10 lcy0x1

Sorry, could you give a more specific example of what problem this could cause?

tterrag1098 avatar Dec 26 '22 01:12 tterrag1098

If I have registry A and registry B, I register aaa, bbb, ddd in registry A, and then register ccc, ddd, eee in registry B. The order in registry B becomes ddd, ccc, eee

This can be fixed by registering items before everything else, though is still good to fix

lcy0x1 avatar Dec 26 '22 01:12 lcy0x1