diff --git a/patches/server/Handle-Item-Meta-Inconsistencies.patch b/patches/server/Handle-Item-Meta-Inconsistencies.patch index b1068b97f..ee7946735 100644 --- a/patches/server/Handle-Item-Meta-Inconsistencies.patch +++ b/patches/server/Handle-Item-Meta-Inconsistencies.patch @@ -42,7 +42,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 BuiltInRegistries.ENCHANTMENT.holderByNameCodec(), LEVEL_CODEC ) - .xmap(Object2IntOpenHashMap::new, Function.identity()); -+ .xmap(Object2IntAVLTreeMap::new, Function.identity()); // Paper ++ // Paper start - sort enchantments ++ .xmap(m -> { ++ final Object2IntAVLTreeMap> map = new Object2IntAVLTreeMap<>(ENCHANTMENT_ORDER); ++ map.putAll(m); ++ return map; ++ }, Function.identity()); ++ // Paper end - sort enchantments private static final Codec FULL_CODEC = RecordCodecBuilder.create( instance -> instance.group( LEVELS_CODEC.fieldOf("levels").forGetter(component -> component.enchantments),