geforkt von Mirrors/Paper
fix enchantment order issue
Dieser Commit ist enthalten in:
Ursprung
f6bd443ff2
Commit
b1f19f295c
@ -42,7 +42,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
BuiltInRegistries.ENCHANTMENT.holderByNameCodec(), LEVEL_CODEC
|
BuiltInRegistries.ENCHANTMENT.holderByNameCodec(), LEVEL_CODEC
|
||||||
)
|
)
|
||||||
- .xmap(Object2IntOpenHashMap::new, Function.identity());
|
- .xmap(Object2IntOpenHashMap::new, Function.identity());
|
||||||
+ .xmap(Object2IntAVLTreeMap::new, Function.identity()); // Paper
|
+ // Paper start - sort enchantments
|
||||||
|
+ .xmap(m -> {
|
||||||
|
+ final Object2IntAVLTreeMap<Holder<Enchantment>> map = new Object2IntAVLTreeMap<>(ENCHANTMENT_ORDER);
|
||||||
|
+ map.putAll(m);
|
||||||
|
+ return map;
|
||||||
|
+ }, Function.identity());
|
||||||
|
+ // Paper end - sort enchantments
|
||||||
private static final Codec<ItemEnchantments> FULL_CODEC = RecordCodecBuilder.create(
|
private static final Codec<ItemEnchantments> FULL_CODEC = RecordCodecBuilder.create(
|
||||||
instance -> instance.group(
|
instance -> instance.group(
|
||||||
LEVELS_CODEC.fieldOf("levels").forGetter(component -> component.enchantments),
|
LEVELS_CODEC.fieldOf("levels").forGetter(component -> component.enchantments),
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren