diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index edf03c7b34..96004a9f7c 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -91,6 +91,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return this.deepConverted().getVisualOrderText(); + } + ++ public Component adventure$component() { ++ return this.adventure; ++ } ++ + public static class Serializer implements JsonSerializer { + @Override + public JsonElement serialize(final AdventureComponent src, final Type type, final JsonSerializationContext context) { @@ -2565,6 +2569,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return message.hasSignature() && !message.hasExpiredServer(Instant.now()); } +diff --git a/src/main/java/net/minecraft/util/ExtraCodecs.java b/src/main/java/net/minecraft/util/ExtraCodecs.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/util/ExtraCodecs.java ++++ b/src/main/java/net/minecraft/util/ExtraCodecs.java +@@ -0,0 +0,0 @@ public class ExtraCodecs { + } + }, (text) -> { + try { ++ // Paper start ++ if (text instanceof io.papermc.paper.adventure.AdventureComponent adventureComponent) { ++ return DataResult.success(net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.gson().serializeToTree(adventureComponent.adventure$component())); ++ } ++ // Paper end + return DataResult.success(Component.Serializer.toJsonTree(text)); + } catch (IllegalArgumentException var2) { + return DataResult.error(var2::getMessage); diff --git a/src/main/java/net/minecraft/world/BossEvent.java b/src/main/java/net/minecraft/world/BossEvent.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/BossEvent.java diff --git a/patches/server/MC-Dev-fixes.patch b/patches/server/MC-Dev-fixes.patch index 0eb27496ed..24766fc43c 100644 --- a/patches/server/MC-Dev-fixes.patch +++ b/patches/server/MC-Dev-fixes.patch @@ -106,6 +106,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } +diff --git a/src/main/java/net/minecraft/util/ExtraCodecs.java b/src/main/java/net/minecraft/util/ExtraCodecs.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/util/ExtraCodecs.java ++++ b/src/main/java/net/minecraft/util/ExtraCodecs.java +@@ -0,0 +0,0 @@ public class ExtraCodecs { + }, (pair) -> { + return ImmutableList.of(leftFunction.apply(pair), rightFunction.apply(pair)); + }); +- Codec codec3 = RecordCodecBuilder.create((instance) -> { ++ Codec codec3 = RecordCodecBuilder.>create((instance) -> { // Paper - decompile fix + return instance.group(codec.fieldOf(leftFieldName).forGetter(Pair::getFirst), codec.fieldOf(rightFieldName).forGetter(Pair::getSecond)).apply(instance, Pair::of); + }).comapFlatMap((pair) -> { + return combineFunction.apply((P)pair.getFirst(), (P)pair.getSecond()); diff --git a/src/main/java/net/minecraft/util/SortedArraySet.java b/src/main/java/net/minecraft/util/SortedArraySet.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/util/SortedArraySet.java diff --git a/patches/server/Remap-fixes.patch b/patches/server/Remap-fixes.patch index d1d3e16cd4..2dc51bebfb 100644 --- a/patches/server/Remap-fixes.patch +++ b/patches/server/Remap-fixes.patch @@ -41,6 +41,28 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } +diff --git a/src/main/java/net/minecraft/util/ExtraCodecs.java b/src/main/java/net/minecraft/util/ExtraCodecs.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/util/ExtraCodecs.java ++++ b/src/main/java/net/minecraft/util/ExtraCodecs.java +@@ -0,0 +0,0 @@ public class ExtraCodecs { + Optional> optional = dataResult.resultOrPartial(mutableObject::setValue); + return optional.isPresent() ? dataResult : DataResult.error(() -> { + return "(" + (String)mutableObject.getValue() + " -> using default)"; +- }, Pair.of(object, object)); ++ }, Pair.of(object, objectx)); // Paper - remapping fix + } + + public DataResult coApply(DynamicOps dynamicOps, A objectx, DataResult dataResult) { +@@ -0,0 +0,0 @@ public class ExtraCodecs { + + static record LazyInitializedCodec(Supplier> delegate) implements Codec { + LazyInitializedCodec { +- supplier = Suppliers.memoize(supplier::get); ++ delegate = Suppliers.memoize(delegate::get); // Paper - remapping fix + } + + public DataResult> decode(DynamicOps dynamicOps, T object) { diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java