Skip to content

Commit e224056

Browse files
committed
update upstream (and fix a few bugs)
1 parent 30cfeef commit e224056

File tree

22 files changed

+124
-103
lines changed

22 files changed

+124
-103
lines changed

.github/workflows/build.yml

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,50 @@
1-
name: Patch and Build
1+
name: Build main
22

3-
on:
4-
push:
5-
branches: [ "**" ]
6-
pull_request:
3+
on: [push]
74

85
jobs:
96
build:
10-
# Only run on PRs if the source branch is on someone else's repo
11-
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
7+
128
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
java: [21]
13+
fail-fast: true
14+
1315
steps:
14-
- name: Checkout Git Repository
15-
uses: actions/checkout@v4
16-
- name: Set up JDK
17-
uses: actions/setup-java@v4
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up JDK ${{ matrix.java }}
19+
uses: actions/setup-java@v3
20+
with:
21+
java-version: ${{ matrix.java }}
22+
distribution: 'adopt'
23+
24+
- name: Cache gradle
25+
uses: actions/cache@v3
26+
with:
27+
path: |
28+
~/.gradle/caches
29+
~/.gradle/jdks
30+
~/.gradle/native
31+
~/.gradle/wrapper
32+
key: ${{ runner.os }}-parchment-2-${{ hashFiles('**/*.gradle*', 'gradle/**', 'gradle.properties') }}
33+
restore-keys: ${{ runner.os }}-parchment-2
34+
35+
- name: Patch Parchment
36+
env:
37+
ORG_GRADLE_PROJECT_edenSnapshotsUsername: ${{ secrets.SONATYPE_USERNAME }}
38+
ORG_GRADLE_PROJECT_edenSnapshotsPassword: ${{ secrets.SONATYPE_PASSWORD }}
39+
run: |
40+
git config --global user.email "no-reply@github.com"
41+
git config --global user.name "GitHub Actions"
42+
./gradlew applyAllPatches
43+
./gradlew createMojmapPaperclipJar
44+
./gradlew :parchment-api:publishMavenPublicationToEdenSnapshotsRepository
45+
./gradlew publishDevBundlePublicationToEdenSnapshotsRepository -PpublishDevBundle
46+
47+
- uses: actions/upload-artifact@v3
1848
with:
19-
distribution: 'temurin'
20-
java-version: '21'
21-
- name: Setup Gradle
22-
uses: gradle/actions/setup-gradle@v4
23-
- name: Configure Git User Details
24-
run: git config --global user.email "actions@github.com" && git config --global user.name "Github Actions"
25-
- name: Apply Patches
26-
run: ./gradlew applyAllPatches --stacktrace
27-
- name: Build
28-
run: ./gradlew build
49+
name: Parchment-JDK${{ matrix.java }}
50+
path: parchment-server/build/libs/parchment-paperclip-*-mojmap.jar

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ Things I've found while just trying to get this to work:
33
- If you've made an update to either of the build.gradle.kts files in api or server, run `./gradlew rebuildPaperSingleFilePatches` after adding to git (no commit)
44
- To create a file patch:
55
- Make the changes you need and have no other staged changes
6-
- cd paper-api or paper-server
6+
- cd **paper-api** or **paper-server** or **parchment-server/src/minecraft/java**
77
- git add .
8-
- git commit --ammend
9-
- This ammends it to the specific 'File Patch Commit'
10-
- ./gradlew rebuildPaper<Api/Server>FilePatches
8+
- git commit --amend
9+
- This ammends it to the specific 'File Patch Commit'
10+
- Then run one of the following
11+
- ./gradlew rebuildPaperApiFilePatches
12+
- ./gradlew rebuildPaperServerFilePatches
13+
- ./gradlew rebuildMinecraftFilePatches

build.gradle.kts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
33

44
plugins {
55
java // TODO java launcher tasks
6-
id("io.papermc.paperweight.patcher") version "2.0.0-beta.13"
6+
id("io.papermc.paperweight.patcher") version "2.0.0-beta.14"
77
}
88

99
paperweight {
@@ -26,11 +26,6 @@ paperweight {
2626
patchesDir = file("parchment-api/paper-patches")
2727
outputDir = file("paper-api")
2828
}
29-
patchDir("paperApiGenerator") {
30-
upstreamPath = "paper-api-generator"
31-
patchesDir = file("parchment-api-generator/paper-patches")
32-
outputDir = file("paper-api-generator")
33-
}
3429
}
3530
}
3631

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
group=gg.projecteden.parchment
22
version=1.21.4-R0.1-SNAPSHOT
33
mcVersion=1.21.4
4-
paperRef=b03d39b5ce6b5046ce6854ddba74e8ae3641c230
4+
paperRef=6cfa2f7f315cbad23d7b12984b751f2721b496b6
55

66
org.gradle.configuration-cache=true
77
org.gradle.caching=true

parchment-api/build.gradle.kts.patch

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717

1818
// api dependencies are listed transitively to API consumers
1919
api("com.google.guava:guava:33.3.1-jre")
20+
@@ -93,7 +_,7 @@
21+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
22+
}
23+
24+
-val generatedApiPath: java.nio.file.Path = layout.projectDirectory.dir("src/generated/java").asFile.toPath()
25+
+val generatedApiPath: java.nio.file.Path = rootProject.layout.projectDirectory.dir("paper-api/src/generated/java").asFile.toPath()
26+
idea {
27+
module {
28+
generatedSourceDirs.add(generatedApiPath.toFile())
2029
@@ -103,6 +_,18 @@
2130
main {
2231
java {

parchment-api/paper-patches/files/src/main/java/org/bukkit/Location.java.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/src/main/java/org/bukkit/Location.java
22
+++ b/src/main/java/org/bukkit/Location.java
3-
@@ -27,13 +_,20 @@
3+
@@ -28,13 +_,20 @@
44
* magnitude than 360 are valid, but may be normalized to any other equivalent
55
* representation by the implementation.
66
*/

parchment-api/paper-patches/files/src/main/java/org/bukkit/OfflinePlayer.java.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
--- a/src/main/java/org/bukkit/OfflinePlayer.java
22
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
3-
@@ -19,7 +_,14 @@
4-
* player that is stored on the disk and can, thus, be retrieved without the
3+
@@ -20,7 +_,14 @@
54
* player needing to be online.
65
*/
6+
@NullMarked
77
-public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable, io.papermc.paper.persistence.PersistentDataViewHolder { // Paper - Add Offline PDC API
88
+public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable, io.papermc.paper.persistence.PersistentDataViewHolder, gg.projecteden.parchment.HasOfflinePlayer, gg.projecteden.parchment.OptionalPlayer { // Parchment
99
+

parchment-api/paper-patches/files/src/main/java/org/bukkit/World.java.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/src/main/java/org/bukkit/World.java
22
+++ b/src/main/java/org/bukkit/World.java
3-
@@ -52,6 +_,36 @@
3+
@@ -53,6 +_,36 @@
44
*/
55
public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder, Keyed, net.kyori.adventure.audience.ForwardingAudience { // Paper
66

parchment-api/paper-patches/files/src/main/java/org/bukkit/block/Block.java.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
/**
1111
* Gets the metadata for this block
12-
@@ -593,6 +_,20 @@
12+
@@ -590,6 +_,20 @@
1313
* @return true if the block was destroyed
1414
*/
1515
boolean breakNaturally(@NotNull ItemStack tool, boolean triggerEffect, boolean dropExperience);

parchment-api/paper-patches/files/src/main/java/org/bukkit/entity/HumanEntity.java.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
22
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
3-
@@ -23,7 +_,14 @@
4-
/**
3+
@@ -25,7 +_,14 @@
54
* Represents a human entity, such as an NPC or a player
65
*/
6+
@NullMarked
77
-public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder {
88
+public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder, gg.projecteden.parchment.HasHumanEntity { // Parchment
99
+
1010
+ // Parchment start
1111
+ @Override
12-
+ default @NotNull HumanEntity getPlayer() {
12+
+ default HumanEntity getPlayer() {
1313
+ return this;
1414
+ }
1515
+ // Parchment end

0 commit comments

Comments
 (0)