Fixed ability orders randomly changing

This commit is contained in:
Sollace 2022-01-01 01:03:22 +02:00
parent 9d5e72cbc1
commit c8a3b7d64d

View file

@ -1,7 +1,7 @@
package com.minelittlepony.unicopia.ability; package com.minelittlepony.unicopia.ability;
import java.util.EnumMap; import java.util.EnumMap;
import java.util.HashSet; import java.util.LinkedHashSet;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import com.minelittlepony.unicopia.util.Registries; import com.minelittlepony.unicopia.util.Registries;
@ -42,7 +42,7 @@ public interface Abilities {
static <T extends Ability<?>> T register(T power, String name, AbilitySlot slot) { static <T extends Ability<?>> T register(T power, String name, AbilitySlot slot) {
Identifier id = new Identifier("unicopia", name); Identifier id = new Identifier("unicopia", name);
BY_SLOT.computeIfAbsent(slot, s -> new HashSet<>()).add(power); BY_SLOT.computeIfAbsent(slot, s -> new LinkedHashSet<>()).add(power);
return Registry.register(REGISTRY, id, power); return Registry.register(REGISTRY, id, power);
} }
} }