Skip to content

Commit

Permalink
Updated Upstream (Paper)
Browse files Browse the repository at this point in the history
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@b6be7cd [ci skip] Move generated API sources to src/generated/java (#11977)
PaperMC/Paper@cd9d6d6 Allow duplicate relative flags in entity teleport
PaperMC/Paper@b1b88cd [ci skip] Update paperweight to 2.0.0-beta.14
  • Loading branch information
granny committed Jan 17, 2025
1 parent dd41439 commit b7f79d4
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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 = $*,|,*
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,5 @@ manifest.mf
/paper-server
/purpur-api/build.gradle.kts
/paper-api
/paper-api-generator
*.jar
test-plugin.settings.gradle.kts
15 changes: 4 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:

Expand Down Expand Up @@ -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
Expand Down
7 changes: 1 addition & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand All @@ -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")
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions purpur-api/build.gradle.kts.patch
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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> ZOMBIE_ATTACK_TURTLE_EGG = create("zombie_attack_turtle_egg", Zombie.class);
Expand Down
6 changes: 1 addition & 5 deletions purpur-server/build.gradle.kts.patch
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -13,10 +13,6 @@
+ }
+ }
+ activeFork = purpur
+
+ paper {
+ paperServerDir = upstreamsDirectory().map { it.dir("paper/paper-server") }
+ }
+
spigot {
buildDataRef = "3edaf46ec1eed4115ce1b18d2846cded42577e42"
Expand Down
4 changes: 2 additions & 2 deletions purpur-server/paper-patches/features/0002-Ridables.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Subject: [PATCH] API for any mob to burn daylight
Co-authored by: Encode42 <[email protected]>

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

Expand Down
Original file line number Diff line number Diff line change
@@ -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());
}

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b7f79d4

Please sign in to comment.