[ci skip] move decomp fixes to correct patch

This commit is contained in:
Jason Penilla 2023-12-11 22:08:51 -08:00
parent 6e3d7add28
commit ebf7955996
2 changed files with 22 additions and 18 deletions

View file

@ -2307,24 +2307,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return Codec.either(Codec.either(Codec.STRING, ExtraCodecs.nonEmptyList(selfCodec.listOf())), codec).xmap((either) -> {
return either.map((either2) -> {
return either2.map(Component::literal, ComponentSerialization::createFromList);
@@ -0,0 +0,0 @@ public class ComponentSerialization {
for(MapDecoder<? extends T> mapDecoder : this.codecs) {
DataResult<? extends T> dataResult = mapDecoder.decode(dynamicOps, mapLike);
if (dataResult.result().isPresent()) {
- return dataResult;
+ return (DataResult<T>) dataResult; // Paper - decomp fix
}
}
@@ -0,0 +0,0 @@ public class ComponentSerialization {
}
public <S> RecordBuilder<S> encode(T object, DynamicOps<S> dynamicOps, RecordBuilder<S> recordBuilder) {
- MapEncoder<T> mapEncoder = this.encoderGetter.apply(object);
+ MapEncoder<T> mapEncoder = (MapEncoder<T>) this.encoderGetter.apply(object); // Paper - decomp fix
return mapEncoder.encode(object, dynamicOps, recordBuilder);
}
diff --git a/src/main/java/net/minecraft/network/chat/ComponentUtils.java b/src/main/java/net/minecraft/network/chat/ComponentUtils.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/network/chat/ComponentUtils.java

View file

@ -52,6 +52,28 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public static final int NOT_REGISTERED = -1;
private final String id;
diff --git a/src/main/java/net/minecraft/network/chat/ComponentSerialization.java b/src/main/java/net/minecraft/network/chat/ComponentSerialization.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/network/chat/ComponentSerialization.java
+++ b/src/main/java/net/minecraft/network/chat/ComponentSerialization.java
@@ -0,0 +0,0 @@ public class ComponentSerialization {
for(MapDecoder<? extends T> mapDecoder : this.codecs) {
DataResult<? extends T> dataResult = mapDecoder.decode(dynamicOps, mapLike);
if (dataResult.result().isPresent()) {
- return dataResult;
+ return (DataResult<T>) dataResult; // Paper - decomp fix
}
}
@@ -0,0 +0,0 @@ public class ComponentSerialization {
}
public <S> RecordBuilder<S> encode(T object, DynamicOps<S> dynamicOps, RecordBuilder<S> recordBuilder) {
- MapEncoder<T> mapEncoder = this.encoderGetter.apply(object);
+ MapEncoder<T> mapEncoder = (MapEncoder<T>) this.encoderGetter.apply(object); // Paper - decomp fix
return mapEncoder.encode(object, dynamicOps, recordBuilder);
}
diff --git a/src/main/java/net/minecraft/network/chat/ComponentUtils.java b/src/main/java/net/minecraft/network/chat/ComponentUtils.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/network/chat/ComponentUtils.java