tterrag1098 / Registrate

Your mod's best friend - keep your registry objects simple and organized
Mozilla Public License 2.0
123 stars 33 forks source link

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

Open lcy0x1 opened 2 years ago

lcy0x1 commented 2 years ago
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

tterrag1098 commented 1 year ago

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

lcy0x1 commented 1 year ago

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