From 98104f3a8b8709af8b91a63744da6a64167e9b85 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sun, 15 Dec 2024 00:13:47 -0700 Subject: [PATCH] rebase on real paper --- build.gradle.kts | 4 +- .../advancement/AdvancementDisplay.java.patch | 11 +++++ fork-server/build.gradle.kts.patch | 43 +++++++++++++++++-- .../features/0001-feature-1.patch | 18 ++++++++ .../block/CraftBlockSoundGroup.java.patch | 10 +++++ .../main/java/test/FakeCraftServer.java.patch | 8 ---- settings.gradle.kts | 10 +---- 7 files changed, 82 insertions(+), 22 deletions(-) create mode 100644 fork-api/paper-patches/files/src/main/java/io/papermc/paper/advancement/AdvancementDisplay.java.patch create mode 100644 fork-server/paper-patches/features/0001-feature-1.patch create mode 100644 fork-server/paper-patches/files/src/main/java/com/destroystokyo/paper/block/CraftBlockSoundGroup.java.patch delete mode 100644 fork-server/paper-patches/files/src/main/java/test/FakeCraftServer.java.patch diff --git a/build.gradle.kts b/build.gradle.kts index 55fca38..00a4cf7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,8 +8,8 @@ plugins { paperweight { upstreams.register("paper") { - repo.set("/Users/jason/IdeaProjects/PaperMC/Softspoon/HistoryTest") - ref.set("775ed1dab47a91c407c40b8b45391df40e357d32") + repo.set("https://github.com/PaperMC/Paper.git") + ref.set("aaf151c03d48f51b10f278e26143dd8ea9db6acb") paper = true patchFile { diff --git a/fork-api/paper-patches/files/src/main/java/io/papermc/paper/advancement/AdvancementDisplay.java.patch b/fork-api/paper-patches/files/src/main/java/io/papermc/paper/advancement/AdvancementDisplay.java.patch new file mode 100644 index 0000000..2bf7c4b --- /dev/null +++ b/fork-api/paper-patches/files/src/main/java/io/papermc/paper/advancement/AdvancementDisplay.java.patch @@ -0,0 +1,11 @@ +--- a/src/main/java/io/papermc/paper/advancement/AdvancementDisplay.java ++++ b/src/main/java/io/papermc/paper/advancement/AdvancementDisplay.java +@@ -27,7 +_,7 @@ + * + * @return the frame type + */ +- Frame frame(); ++ Frame frame(); // patch + + /** + * Gets the advancement title. diff --git a/fork-server/build.gradle.kts.patch b/fork-server/build.gradle.kts.patch index d80ffb5..dfbc9dc 100644 --- a/fork-server/build.gradle.kts.patch +++ b/fork-server/build.gradle.kts.patch @@ -1,6 +1,13 @@ --- a/paper-server/build.gradle.kts +++ b/paper-server/build.gradle.kts -@@ -21,25 +_,38 @@ +@@ -1,5 +_,5 @@ + import io.papermc.paperweight.attribute.DevBundleOutput +-import io.papermc.paperweight.core.ext ++import io.papermc.paperweight.core.coreExt + import io.papermc.paperweight.util.* + import java.time.Instant + +@@ -22,25 +_,38 @@ // macheOldPath = file("F:\\Projects\\PaperTooling\\mache\\versions\\1.21.4\\src\\main\\java") // gitFilePatches = true @@ -51,7 +58,18 @@ } tasks.generateDevelopmentBundle { -@@ -104,7 +_,20 @@ +@@ -52,8 +_,8 @@ + + // TODO remove me again, this is just to not run setupMacheSource when patches change + tasks.setupMacheSources { +- paperPatches.setFrom(project.ext.paper.sourcePatchDir.dir("com"), project.ext.paper.featurePatchDir) +- // paperPatches.from(project.ext.paper.sourcePatchDir, project.ext.paper.featurePatchDir) ++ // paperPatches.setFrom(project.coreExt.paper.sourcePatchDir.dir("com"), project.coreExt.paper.featurePatchDir) ++ // paperPatches.from(project.coreExt.paper.sourcePatchDir, project.ext.paper.featurePatchDir) + } + + abstract class Services { +@@ -111,7 +_,20 @@ } } @@ -73,7 +91,7 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) { extendsFrom(configurations.compileClasspath.get()) } -@@ -123,7 +_,7 @@ +@@ -130,7 +_,7 @@ // Paper end - configure mockito agent that is needed in newer java versions dependencies { @@ -82,7 +100,7 @@ implementation("ca.spottedleaf:concurrentutil:0.0.2") // Paper - Add ConcurrentUtil dependency // Paper start implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+ -@@ -261,7 +_,7 @@ +@@ -263,7 +_,7 @@ name: String, block: JavaExec.() -> Unit ): TaskProvider = register(name) { @@ -91,3 +109,20 @@ mainClass.set("org.bukkit.craftbukkit.Main") standardInput = System.`in` workingDir = rootProject.layout.projectDirectory +@@ -324,7 +_,7 @@ + } + tasks.registerRunTask("runReobfBundler") { + description = "Spin up a test server from the reobf bundler jar" +- classpath(rootProject.tasks.named("createReobfBundlerJar").flatMap { it.outputZip }) ++ classpath(tasks.named("createReobfBundlerJar").flatMap { it.outputZip }) + mainClass.set(null as String?) + } + tasks.registerRunTask("runPaperclip") { +@@ -334,6 +_,6 @@ + } + tasks.registerRunTask("runReobfPaperclip") { + description = "Spin up a test server from the reobf Paperclip jar" +- classpath(rootProject.tasks.named("createReobfPaperclipJar").flatMap { it.outputZip }) ++ classpath(tasks.named("createReobfPaperclipJar").flatMap { it.outputZip }) + mainClass.set(null as String?) + } diff --git a/fork-server/paper-patches/features/0001-feature-1.patch b/fork-server/paper-patches/features/0001-feature-1.patch new file mode 100644 index 0000000..254c4f6 --- /dev/null +++ b/fork-server/paper-patches/features/0001-feature-1.patch @@ -0,0 +1,18 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> +Date: Sun, 15 Dec 2024 00:07:29 -0700 +Subject: [PATCH] feature 1 + + +diff --git a/src/main/java/com/destroystokyo/paper/block/CraftBlockSoundGroup.java b/src/main/java/com/destroystokyo/paper/block/CraftBlockSoundGroup.java +index 054ee606e7c36712e474e2b7093b436e043e6262..9d395898511ed5b408dacfb9c796baacb18b9430 100644 +--- a/src/main/java/com/destroystokyo/paper/block/CraftBlockSoundGroup.java ++++ b/src/main/java/com/destroystokyo/paper/block/CraftBlockSoundGroup.java +@@ -20,6 +20,7 @@ public class CraftBlockSoundGroup implements BlockSoundGroup { + @Override + public Sound getStepSound() { + // file patch ++ // feature patch + return CraftSound.minecraftToBukkit(soundEffectType.getStepSound()); + } + diff --git a/fork-server/paper-patches/files/src/main/java/com/destroystokyo/paper/block/CraftBlockSoundGroup.java.patch b/fork-server/paper-patches/files/src/main/java/com/destroystokyo/paper/block/CraftBlockSoundGroup.java.patch new file mode 100644 index 0000000..cb56c8a --- /dev/null +++ b/fork-server/paper-patches/files/src/main/java/com/destroystokyo/paper/block/CraftBlockSoundGroup.java.patch @@ -0,0 +1,10 @@ +--- a/src/main/java/com/destroystokyo/paper/block/CraftBlockSoundGroup.java ++++ b/src/main/java/com/destroystokyo/paper/block/CraftBlockSoundGroup.java +@@ -19,6 +_,7 @@ + + @Override + public Sound getStepSound() { ++ // file patch + return CraftSound.minecraftToBukkit(soundEffectType.getStepSound()); + } + diff --git a/fork-server/paper-patches/files/src/main/java/test/FakeCraftServer.java.patch b/fork-server/paper-patches/files/src/main/java/test/FakeCraftServer.java.patch deleted file mode 100644 index 797936f..0000000 --- a/fork-server/paper-patches/files/src/main/java/test/FakeCraftServer.java.patch +++ /dev/null @@ -1,8 +0,0 @@ ---- a/src/main/java/test/FakeCraftServer.java -+++ b/src/main/java/test/FakeCraftServer.java -@@ -1,4 +_,5 @@ - package test; - - public class FakeCraftServer { -+ // Forked - } diff --git a/settings.gradle.kts b/settings.gradle.kts index f10e391..fb5080d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -12,11 +12,5 @@ plugins { rootProject.name = "fork" -val forkApiDir = file("fork-api") -if (forkApiDir.exists()) { - include(forkApiDir.name) -} -val forkServerDir = file("fork-server") -if (forkServerDir.exists()) { - include(forkServerDir.name) -} +include("fork-api") +include("fork-server")