diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index e56ccde62e..cc8b8e46da 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -5638,11 +5638,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/resources/META-INF/services/net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer$Provider @@ -0,0 +1 @@ +io.papermc.paper.adventure.providers.PlainTextComponentSerializerProviderImpl -diff --git a/src/main/resources/data/paper/chat_type/raw.json b/src/main/resources/data/paper/chat_type/raw.json +diff --git a/src/main/resources/data/minecraft/datapacks/paper/data/paper/chat_type/raw.json b/src/main/resources/data/minecraft/datapacks/paper/data/paper/chat_type/raw.json new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 --- /dev/null -+++ b/src/main/resources/data/paper/chat_type/raw.json ++++ b/src/main/resources/data/minecraft/datapacks/paper/data/paper/chat_type/raw.json @@ -0,0 +0,0 @@ +{ + "chat": { diff --git a/patches/server/Build-system-changes.patch b/patches/server/Build-system-changes.patch index 17b61f0a36..74711b410d 100644 --- a/patches/server/Build-system-changes.patch +++ b/patches/server/Build-system-changes.patch @@ -110,6 +110,52 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 .applyDevelopmentConfig() .pushJarResources() .build(VANILLA_PACK_INFO); +@@ -0,0 +0,0 @@ public class ServerPacksSource extends BuiltInPackSource { + @Nullable + @Override + protected Pack createBuiltinPack(String fileName, Pack.ResourcesSupplier packFactory, Component displayName) { +- return Pack.readMetaAndCreate(createBuiltInPackLocation(fileName, displayName), packFactory, PackType.SERVER_DATA, FEATURE_SELECTION_CONFIG); ++ // Paper start - custom built-in pack ++ final PackLocationInfo info; ++ if ("paper".equals(fileName)) { ++ info = new PackLocationInfo(fileName, displayName, PackSource.BUILT_IN, Optional.empty()); ++ } else { ++ info = createBuiltInPackLocation(fileName, displayName); ++ } ++ return Pack.readMetaAndCreate(info, packFactory, PackType.SERVER_DATA, FEATURE_SELECTION_CONFIG); ++ // Paper end - custom built-in pack + } + + public static PackRepository createPackRepository(Path dataPacksPath, DirectoryValidator symlinkFinder) { +diff --git a/src/main/java/net/minecraft/world/level/DataPackConfig.java b/src/main/java/net/minecraft/world/level/DataPackConfig.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/DataPackConfig.java ++++ b/src/main/java/net/minecraft/world/level/DataPackConfig.java +@@ -0,0 +0,0 @@ public class DataPackConfig { + public static final DataPackConfig DEFAULT = new DataPackConfig(ImmutableList.of("vanilla"), ImmutableList.of()); + public static final Codec CODEC = RecordCodecBuilder.create( + instance -> instance.group( +- Codec.STRING.listOf().fieldOf("Enabled").forGetter(settings -> settings.enabled), +- Codec.STRING.listOf().fieldOf("Disabled").forGetter(settings -> settings.disabled) ++ Codec.STRING.listOf().validate(DataPackConfig::ensureEnabled).fieldOf("Enabled").forGetter(settings -> settings.enabled), // Paper - ensure "paper" is always enabled ++ Codec.STRING.listOf().validate(DataPackConfig::ensureNotDisabled).fieldOf("Disabled").forGetter(settings -> settings.disabled) // Paper - ensure "paper" is always enabled + ) + .apply(instance, DataPackConfig::new) + ); +@@ -0,0 +0,0 @@ public class DataPackConfig { + public List getDisabled() { + return this.disabled; + } ++ // Paper start - ensure "paper" datapack is always enabled ++ private static com.mojang.serialization.DataResult> ensureEnabled(final List enabled) { ++ return com.mojang.serialization.DataResult.success(enabled.contains("paper") ? enabled: io.papermc.paper.util.MCUtil.copyListAndAdd(enabled, "paper")); ++ } ++ ++ private static com.mojang.serialization.DataResult> ensureNotDisabled(final List disabled) { ++ return com.mojang.serialization.DataResult.success(io.papermc.paper.util.MCUtil.copyListAndRemoveIf(disabled, "paper"::equals)); ++ } ++ // Paper end - ensure "paper" datapack is always enabled + } diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java @@ -139,6 +185,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 diff --git a/src/main/resources/data/.paperassetsroot b/src/main/resources/data/.paperassetsroot new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 +diff --git a/src/main/resources/data/minecraft/datapacks/paper/pack.mcmeta b/src/main/resources/data/minecraft/datapacks/paper/pack.mcmeta +new file mode 100644 +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 +--- /dev/null ++++ b/src/main/resources/data/minecraft/datapacks/paper/pack.mcmeta +@@ -0,0 +0,0 @@ ++{ ++ "pack": { ++ "description": "Built-in Paper Datapack", ++ "pack_format": 41 ++ } ++} diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/test/java/org/bukkit/support/AbstractTestingBase.java diff --git a/patches/server/Custom-Potion-Mixes.patch b/patches/server/Custom-Potion-Mixes.patch index 09da7ef7a4..662a02100a 100644 --- a/patches/server/Custom-Potion-Mixes.patch +++ b/patches/server/Custom-Potion-Mixes.patch @@ -35,11 +35,20 @@ diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop public (remove final) + private volatile boolean isSaving; + + // CraftBukkit start @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop