mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 06:30:46 +01:00
Fix the incorrect codec usage in the Style convert (#10465)
This commit is contained in:
parent
0b9087f4b8
commit
d1a11cca31
1 changed files with 2 additions and 2 deletions
|
@ -1624,7 +1624,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ public static net.minecraft.network.chat.Style asVanilla(final Style style) {
|
+ public static net.minecraft.network.chat.Style asVanilla(final Style style) {
|
||||||
+ final RegistryOps<Object> ops = RegistryOps.create(JavaOps.INSTANCE, CraftRegistry.getMinecraftRegistry());
|
+ final RegistryOps<Object> ops = RegistryOps.create(JavaOps.INSTANCE, CraftRegistry.getMinecraftRegistry());
|
||||||
+ final Object encoded = AdventureCodecs.STYLE_MAP_CODEC.codec()
|
+ final Object encoded = AdventureCodecs.STYLE_MAP_CODEC.codec()
|
||||||
+ .parse(ops, style).getOrThrow(IllegalStateException::new);
|
+ .encodeStart(ops, style).getOrThrow(IllegalStateException::new);
|
||||||
+
|
+
|
||||||
+ return net.minecraft.network.chat.Style.Serializer.CODEC
|
+ return net.minecraft.network.chat.Style.Serializer.CODEC
|
||||||
+ .parse(ops, encoded).getOrThrow(IllegalStateException::new);
|
+ .parse(ops, encoded).getOrThrow(IllegalStateException::new);
|
||||||
|
@ -1633,7 +1633,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ public static Style asAdventure(final net.minecraft.network.chat.Style style) {
|
+ public static Style asAdventure(final net.minecraft.network.chat.Style style) {
|
||||||
+ final RegistryOps<Object> ops = RegistryOps.create(JavaOps.INSTANCE, CraftRegistry.getMinecraftRegistry());
|
+ final RegistryOps<Object> ops = RegistryOps.create(JavaOps.INSTANCE, CraftRegistry.getMinecraftRegistry());
|
||||||
+ final Object encoded = net.minecraft.network.chat.Style.Serializer.CODEC
|
+ final Object encoded = net.minecraft.network.chat.Style.Serializer.CODEC
|
||||||
+ .parse(ops, style).getOrThrow(IllegalStateException::new);
|
+ .encodeStart(ops, style).getOrThrow(IllegalStateException::new);
|
||||||
+
|
+
|
||||||
+ return AdventureCodecs.STYLE_MAP_CODEC.codec()
|
+ return AdventureCodecs.STYLE_MAP_CODEC.codec()
|
||||||
+ .parse(ops, encoded).getOrThrow(IllegalStateException::new);
|
+ .parse(ops, encoded).getOrThrow(IllegalStateException::new);
|
||||||
|
|
Loading…
Reference in a new issue