From 8b2bb68b60b2bd7cb3326c89b791ca202dd572fd Mon Sep 17 00:00:00 2001 From: Bjarne Koll Date: Wed, 24 Jul 2024 17:04:40 +0200 Subject: [PATCH] Update to 1.21 --- build.gradle.kts | 2 +- gradle.properties | 6 +- patches/server/0001-Build-changes.patch | 77 +++++++++++++++---------- 3 files changed, 50 insertions(+), 35 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 88dce670d..cc8091ef3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,7 +16,7 @@ repositories { } dependencies { - remapper("net.fabricmc:tiny-remapper:0.10.2:fat") // Must be kept in sync with upstream + remapper("net.fabricmc:tiny-remapper:0.10.3:fat") // Must be kept in sync with upstream decompiler("org.vineflower:vineflower:1.10.1") // Must be kept in sync with upstream paperclip("io.papermc:paperclip:3.0.3") // You probably want this to be kept in sync with upstream } diff --git a/gradle.properties b/gradle.properties index e20750f58..28e763fbd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,8 @@ group=com.example.paperfork -version=1.20.6-R0.1-SNAPSHOT +version=1.21-R0.1-SNAPSHOT -mcVersion=1.20.6 -paperRef=3fc93581bb876e8149b2ca423375a98f5ca12d27 +mcVersion=1.21 +paperRef=5a5035be964f3350b06264a31d8add2fa9d2994f org.gradle.caching=true org.gradle.parallel=true diff --git a/patches/server/0001-Build-changes.patch b/patches/server/0001-Build-changes.patch index b105d748b..a916aa26a 100644 --- a/patches/server/0001-Build-changes.patch +++ b/patches/server/0001-Build-changes.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Build changes diff --git a/build.gradle.kts b/build.gradle.kts -index 87bb3fd9b97506f61734ae7f2e6860610ba794e7..7e2017f8fceeadc39f82c1559f3b78bf43e055d0 100644 +index 421f6b3dc8890d63d2e7aa774d0bf8f7e15890ab..2e616a1bb34aebfa3999370ec3e5d7b0d61d6cef 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -12,7 +12,7 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) { +@@ -13,7 +13,7 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) { val alsoShade: Configuration by configurations.creating dependencies { @@ -17,16 +17,27 @@ index 87bb3fd9b97506f61734ae7f2e6860610ba794e7..7e2017f8fceeadc39f82c1559f3b78bf // Paper start implementation("org.jline:jline-terminal-jansi:3.21.0") implementation("net.minecrell:terminalconsoleappender:1.3.0") -@@ -78,7 +78,7 @@ tasks.jar { +@@ -84,14 +84,14 @@ tasks.jar { + val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", - "Implementation-Title" to "CraftBukkit", -- "Implementation-Version" to "git-Paper-$implementationVersion", -+ "Implementation-Version" to "git-ForkTest-$implementationVersion", // ForkTest +- "Implementation-Title" to "Paper", ++ "Implementation-Title" to "ForkTest", // ForkTest - rename + "Implementation-Version" to implementationVersion, "Implementation-Vendor" to date, // Paper - "Specification-Title" to "Bukkit", +- "Specification-Title" to "Paper", ++ "Specification-Title" to "ForkTest", // ForkTest - rename "Specification-Version" to project.version, -@@ -137,7 +137,7 @@ fun TaskContainer.registerRunTask( +- "Specification-Vendor" to "Paper Team", +- "Brand-Id" to "papermc:paper", +- "Brand-Name" to "Paper", ++ "Specification-Vendor" to "ForkTest Team", // ForkTest - rename ++ "Brand-Id" to "forktestmc:forktest", // ForkTest - rename ++ "Brand-Name" to "ForkTest", // ForkTest - rename + "Build-Number" to (build ?: ""), + "Build-Time" to Instant.now().toString(), + "Git-Branch" to gitBranch, // Paper +@@ -148,7 +148,7 @@ fun TaskContainer.registerRunTask( name: String, block: JavaExec.() -> Unit ): TaskProvider = register(name) { @@ -35,32 +46,36 @@ index 87bb3fd9b97506f61734ae7f2e6860610ba794e7..7e2017f8fceeadc39f82c1559f3b78bf mainClass.set("org.bukkit.craftbukkit.Main") standardInput = System.`in` workingDir = rootProject.layout.projectDirectory -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 39303bb4e336732db0ab19dee0c1f8b609bbb134..55d308d092b2c7c0d02e46f0cb255aec59d28049 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1926,7 +1926,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! - } + private static final String BRAND_PAPER_NAME = "Paper"; ++ private static final String BRAND_FORKTEST_NAME = "ForkTest"; // ForkTest - rename + + private static final String BUILD_DEV = "DEV"; - public SystemReport fillSystemReport(SystemReport details) { -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index da1aed63af837b193900bb85393611edbd56c363..6acf6e1acbcc21444d015bdd49901d078736498b 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -269,7 +269,7 @@ import javax.annotation.Nullable; // Paper - import javax.annotation.Nonnull; // Paper +@@ -44,7 +45,7 @@ public record ServerBuildInfoImpl( + .map(Key::key) + .orElse(BRAND_PAPER_ID), + getManifestAttribute(manifest, ATTRIBUTE_BRAND_NAME) +- .orElse(BRAND_PAPER_NAME), ++ .orElse(BRAND_FORKTEST_NAME), // ForkTest - rename + SharedConstants.getCurrentVersion().getId(), + SharedConstants.getCurrentVersion().getName(), + getManifestAttribute(manifest, ATTRIBUTE_BUILD_NUMBER) +@@ -61,7 +62,7 @@ public record ServerBuildInfoImpl( + + @Override + public boolean isBrandCompatible(final @NotNull Key brandId) { +- return brandId.equals(this.brandId); ++ return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID); // ForkTest - rename - forktest supports both paper and forktest plugins. + } - public final class CraftServer implements Server { -- private final String serverName = "Paper"; // Paper -+ private final String serverName = "ForkTest"; // ForkTest // Paper - private final String serverVersion; - private final String bukkitVersion = Versioning.getBukkitVersion(); - private final Logger logger = Logger.getLogger("Minecraft"); + @Override diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java index 774556a62eb240da42e84db4502e2ed43495be17..21f39bd0c33ef2635249298e6a247afba8b05742 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java