diff --git a/.editorconfig b/.editorconfig index 11c88eec2..98a181da1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -40,5 +40,5 @@ ij_java_use_fq_class_names = true [purpur-server/src/minecraft/resources/data/**/*.json] indent_size = 2 -[paper-api-generator/generated/**/*.java] +[paper-api/src/generated/**/*.java] ij_java_imports_layout = $*,|,* diff --git a/.gitignore b/.gitignore index 230f52dce..707f5e4b7 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,5 @@ manifest.mf /paper-server /purpur-api/build.gradle.kts /paper-api -/paper-api-generator *.jar test-plugin.settings.gradle.kts diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d0f8332a4..2d4c58015 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,14 +46,8 @@ javac 21.0.5 ## Understanding Patches Unlike the Purpur API and its implementation, modifications to Paper and Minecraft source files -are done through patches. These patches/extensions are split into different -three different sets of two categories, which are formatted like so: - -Under `purpur-api-generator`: - -- `paper-patches` (applies to the `paper-api/` git repo) - - `sources`: Per-file patches to Paper API Generator classes; - - `features`: Larger feature patches that modify multiple Paper API Generator classes. +are done through patches. These patches/extensions are split into three different sets of two +categories, which are formatted like so: Under `purpur-api`: @@ -81,13 +75,12 @@ Assuming you have already forked the repository: 2. Type `./gradlew applyAllPatches` in a terminal to apply the patches to both paper and minecraft classes. On Windows, remove `./` from the beginning of `gradlew` commands; 3. cd into `purpur-server` for server changes, `purpur-api` for API changes, - `paper-api` for Paper API changes, `paper-api-generator` for Paper API Generator changes, - and `paper-server` for Paper Server changes. + `paper-api` for Paper API changes, and `paper-server` for Paper Server changes. `purpur-server/src/minecraft/java` and `purpur-server/src/minecraft/java/resources` are not git repositories in the traditional sense. Its initial commits are the decompiled and deobfuscated Minecraft source and resource files. The per-file patches are applied on top of these files as a single, large commit, which is then followed -by the individual feature-patch commits. `paper-api/`, `paper-api-generator/`, and `paper-server/` +by the individual feature-patch commits. `paper-api/` and `paper-server/` follow the same concept; each paper "project" has its own git repository that also includes it's own feature and per-file patches. ## Understanding the Gradle Tasks diff --git a/build.gradle.kts b/build.gradle.kts index 2c5e648da..55d26f597 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent plugins { java // TODO java launcher tasks - id("io.papermc.paperweight.patcher") version "2.0.0-beta.13" + id("io.papermc.paperweight.patcher") version "2.0.0-beta.14" } val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/" @@ -28,11 +28,6 @@ paperweight { patchesDir = file("purpur-api/paper-patches") outputDir = file("paper-api") } - patchDir("paperApiGenerator") { - upstreamPath = "paper-api-generator" - patchesDir = file("purpur-api-generator/paper-patches") - outputDir = file("paper-api-generator") - } } } diff --git a/gradle.properties b/gradle.properties index 83fd6c8a8..d51ffb5b6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group = org.purpurmc.purpur version = 1.21.4-R0.1-SNAPSHOT mcVersion = 1.21.4 -paperCommit = 8e80d4e15852ffbed1a18d1e9b34550191433200 +paperCommit = b1b88cd31687c5b3f80c4b0b51fd93a63b3e2498 org.gradle.configuration-cache = true #org.gradle.caching = true diff --git a/purpur-api/build.gradle.kts.patch b/purpur-api/build.gradle.kts.patch index 3f880d605..5f295dd9c 100644 --- a/purpur-api/build.gradle.kts.patch +++ b/purpur-api/build.gradle.kts.patch @@ -1,5 +1,14 @@ --- a/paper-api/build.gradle.kts +++ b/paper-api/build.gradle.kts +@@ -93,7 +_,7 @@ + testRuntimeOnly("org.junit.platform:junit-platform-launcher") + } + +-val generatedApiPath: java.nio.file.Path = layout.projectDirectory.dir("src/generated/java").asFile.toPath() ++val generatedApiPath: java.nio.file.Path = rootProject.layout.projectDirectory.dir("paper-api/src/generated/java").asFile.toPath() + idea { + module { + generatedSourceDirs.add(generatedApiPath.toFile()) @@ -103,6 +_,18 @@ main { java { diff --git a/purpur-api-generator/paper-patches/files/generated/com/destroystokyo/paper/entity/ai/VanillaGoal.java.patch b/purpur-api/paper-patches/files/src/generated/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java.patch similarity index 92% rename from purpur-api-generator/paper-patches/files/generated/com/destroystokyo/paper/entity/ai/VanillaGoal.java.patch rename to purpur-api/paper-patches/files/src/generated/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java.patch index 0173a42d9..b21f25fa2 100644 --- a/purpur-api-generator/paper-patches/files/generated/com/destroystokyo/paper/entity/ai/VanillaGoal.java.patch +++ b/purpur-api/paper-patches/files/src/generated/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java.patch @@ -1,5 +1,5 @@ ---- a/generated/com/destroystokyo/paper/entity/ai/VanillaGoal.java -+++ b/generated/com/destroystokyo/paper/entity/ai/VanillaGoal.java +--- a/src/generated/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java ++++ b/src/generated/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java @@ -441,6 +_,26 @@ GoalKey ZOMBIE_ATTACK_TURTLE_EGG = create("zombie_attack_turtle_egg", Zombie.class); diff --git a/purpur-server/build.gradle.kts.patch b/purpur-server/build.gradle.kts.patch index 04c855e1a..59cc82d61 100644 --- a/purpur-server/build.gradle.kts.patch +++ b/purpur-server/build.gradle.kts.patch @@ -1,6 +1,6 @@ --- a/paper-server/build.gradle.kts +++ b/paper-server/build.gradle.kts -@@ -21,6 +_,20 @@ +@@ -21,6 +_,16 @@ // macheOldPath = file("F:\\Projects\\PaperTooling\\mache\\versions\\1.21.4\\src\\main\\java") // gitFilePatches = true @@ -13,10 +13,6 @@ + } + } + activeFork = purpur -+ -+ paper { -+ paperServerDir = upstreamsDirectory().map { it.dir("paper/paper-server") } -+ } + spigot { buildDataRef = "3edaf46ec1eed4115ce1b18d2846cded42577e42" diff --git a/purpur-server/paper-patches/features/0002-Ridables.patch b/purpur-server/paper-patches/features/0002-Ridables.patch index c461807c4..39fb5ad6b 100644 --- a/purpur-server/paper-patches/features/0002-Ridables.patch +++ b/purpur-server/paper-patches/features/0002-Ridables.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Ridables diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 03ff6e062f92d0405dcf10bd35c6ba2fa553b8c0..4e584c69e3f13e7e441dc8a69d57287fc349841d 100644 +index b0be1ef065986c7e8aa94dde814a303d1dec5529..c843d28de6cdd7fa25cfbfe7cf071de063df05f8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1344,4 +1344,27 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1345,4 +1345,27 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { } } // Paper end - broadcast hurt animation diff --git a/purpur-server/paper-patches/features/0005-Add-EntityTeleportHinderedEvent.patch b/purpur-server/paper-patches/features/0005-Add-EntityTeleportHinderedEvent.patch index 01efc18a3..2b25aa727 100644 --- a/purpur-server/paper-patches/features/0005-Add-EntityTeleportHinderedEvent.patch +++ b/purpur-server/paper-patches/features/0005-Add-EntityTeleportHinderedEvent.patch @@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 4e584c69e3f13e7e441dc8a69d57287fc349841d..762cd2f3a18bcb4039f8d232f1175aaac4ef623d 100644 +index c843d28de6cdd7fa25cfbfe7cf071de063df05f8..3bb597cbce650e408273c07a7c120845c99b053b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -260,6 +260,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -261,6 +261,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { boolean retainPassengers = flagSet.contains(io.papermc.paper.entity.TeleportFlag.EntityState.RETAIN_PASSENGERS); // Don't allow teleporting between worlds while keeping passengers if (flagSet.contains(io.papermc.paper.entity.TeleportFlag.EntityState.RETAIN_PASSENGERS) && this.entity.isVehicle() && location.getWorld() != this.getWorld()) { diff --git a/purpur-server/paper-patches/features/0006-API-for-any-mob-to-burn-daylight.patch b/purpur-server/paper-patches/features/0006-API-for-any-mob-to-burn-daylight.patch index ad8c5190d..98be00b6e 100644 --- a/purpur-server/paper-patches/features/0006-API-for-any-mob-to-burn-daylight.patch +++ b/purpur-server/paper-patches/features/0006-API-for-any-mob-to-burn-daylight.patch @@ -6,10 +6,10 @@ Subject: [PATCH] API for any mob to burn daylight Co-authored by: Encode42 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 762cd2f3a18bcb4039f8d232f1175aaac4ef623d..8755fc950af21e076858de7aafe3b562982299cf 100644 +index 3bb597cbce650e408273c07a7c120845c99b053b..dca2761fe4765c6e95b5db0d0cb5c818eb8697b4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -101,6 +101,13 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -102,6 +102,13 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { } // Purpur end - Fire Immunity API diff --git a/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java.patch b/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java.patch index 82e4f1b76..fd0fe6186 100644 --- a/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java.patch +++ b/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java.patch @@ -1,6 +1,6 @@ --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -89,6 +_,18 @@ +@@ -90,6 +_,18 @@ this.entityType = CraftEntityType.minecraftToBukkit(entity.getType()); } diff --git a/settings.gradle.kts b/settings.gradle.kts index ce2ad53be..11c5dd958 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -32,7 +32,7 @@ if (!file(".git").exists()) { } rootProject.name = "purpur" -for (name in listOf("purpur-api", "purpur-server", "purpur-api-generator")) { +for (name in listOf("purpur-api", "purpur-server")) { val projName = name.lowercase(Locale.ENGLISH) include(projName) findProject(":$projName")!!.projectDir = file(name)