Skip to content

Commit 73f4434

Browse files
committed
hardfork from paper 😊
1 parent aa0bf38 commit 73f4434

File tree

197 files changed

+108
-1256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+108
-1256
lines changed

CONTRIBUTING.md

+8-19
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,16 @@ javac 21.0.5
4545

4646
## Understanding Patches
4747

48-
Unlike the Purpur API and its implementation, modifications to Paper and Minecraft source files
48+
Unlike the Purpur API and its implementation, modifications to the Minecraft source files
4949
are done through patches. These patches/extensions are split into three different sets of two
5050
categories, which are formatted like so:
5151

52-
Under `purpur-api`:
53-
54-
- `paper-patches` (applies to the `paper-server/` git repo)
55-
- `sources`: Per-file patches to Paper API classes;
56-
- `features`: Larger feature patches that modify multiple Paper API classes.
57-
5852
Under `purpur-server`:
5953

6054
- `minecraft-patches` (applies to the `purpur-server//` git repo)
6155
- `sources`: Per-file patches to Minecraft classes;
6256
- `resources`: Per-file patches to Minecraft data files;
6357
- `features`: Larger feature patches that modify multiple classes.
64-
- `paper-patches`
65-
- `sources`: Per-file patches to Paper Server classes;
66-
- `features`: Larger feature patches that modify multiple Paper Server classes.
6758

6859
Because this entire structure is based on patches and git, a basic understanding
6960
of how to use git is required. A basic tutorial can be found here:
@@ -72,16 +63,14 @@ of how to use git is required. A basic tutorial can be found here:
7263
Assuming you have already forked the repository:
7364

7465
1. Clone your fork to your local machine;
75-
2. Type `./gradlew applyAllPatches` in a terminal to apply the patches to both paper and minecraft classes.
66+
2. Type `./gradlew applyPatches` in a terminal to apply the patches to minecraft classes.
7667
On Windows, remove `./` from the beginning of `gradlew` commands;
77-
3. cd into `purpur-server` for server changes, `purpur-api` for API changes,
78-
`paper-api` for Paper API changes, and `paper-server` for Paper Server changes.
68+
3. cd into `purpur-server` for server changes, `purpur-api` for API changes.
7969

8070
`purpur-server/src/minecraft/java` and `purpur-server/src/minecraft/java/resources` are not git repositories in the traditional sense.
8171
Its initial commits are the decompiled and deobfuscated Minecraft source and resource files. The per-file
8272
patches are applied on top of these files as a single, large commit, which is then followed
83-
by the individual feature-patch commits. `paper-api/` and `paper-server/`
84-
follow the same concept; each paper "project" has its own git repository that also includes it's own feature and per-file patches.
73+
by the individual feature-patch commits.
8574

8675
## Understanding the Gradle Tasks
8776

@@ -98,12 +87,12 @@ Each "project" that includes a local git repository has the following available
9887

9988
Some additional useful tasks are listed below:
10089

101-
- `./gradlew applyAllPatches` - Applies all patches defined in the paperweight-patcher project and the server project. (equivalent to running `applyPaperPatches` and then `applyAllServerPatches` in a second Gradle invocation)
90+
- `./gradlew applyAllPatches` - Applies all patches defined in the paperweight-patcher project and the server project. (equivalent to running `applyPatches` and then `applyAllServerPatches` in a second Gradle invocation)
10291
- `./gradlew applyAllServerFeaturePatches` - Applies all Minecraft and upstream server feature patches (equivalent to `applyMinecraftFeaturePatches applyServerFeaturePatches`)
10392
- `./gradlew applyAllServerFilePatches` - Applies all Minecraft and upstream server file patches (equivalent to `applyMinecraftFilePatches applyServerFilePatches`)
10493
- `./gradlew applyAllServerPatches` - Applies all Minecraft and upstream server patches (equivalent to `applyMinecraftPatches applyServerPatches`)
10594

106-
- `./gradlew rebuildPaperSingleFilePatches` - Fixups and rebuilds all paper single-file patches. This is how you'd make changes to the `build.gradle.kts` files located under `purpur-api` and `purpur-server`
95+
- `./gradlew rebuildSingleFilePatches` - Fixups and rebuilds all single-file patches. This is how you'd make changes to the `build.gradle.kts` files located under `purpur-api` and `purpur-server`
10796

10897
## Modifying (per-file) patches
10998

@@ -229,7 +218,7 @@ when making and submitting changes.
229218

230219
## Formatting
231220

232-
All modifications to Minecraft files and Paper files should be marked. For historical reasons,
221+
All modifications to Minecraft files should be marked. For historical reasons,
233222
API and API-implementation contain a lot of these too, but they are no longer
234223
required.
235224

@@ -273,7 +262,7 @@ into most IDEs and formatters by default. There are a few notes, however:
273262
hard to parse generics in a case where the base type itself is already obvious.
274263

275264
### Imports
276-
When adding new imports to a Minecraft or Paper class, use the fully qualified class name
265+
When adding new imports to a Minecraft class, use the fully qualified class name
277266
instead of adding a new import to the top of the file. If you are using a type a significant number of times, you
278267
can add an import with a comment. However, if it's only used a couple of times, the FQN is preferred to prevent future
279268
patch conflicts in the import section of the file.

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
[![Forks](https://img.shields.io/github/forks/PurpurMC/Purpur?label=forks&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9bxSIVh1YQcYhQnSyIiuimVShChVArtOpgcukXNGlIUlwcBdeCgx+LVQcXZ10dXAVB8APE0clJ0UVK/F9SaBHjwXE/3t173L0D/PUyU82OMUDVLCOViAuZ7KrQ9YogwujDEGYkZupzopiE5/i6h4+vdzGe5X3uz9Gj5EwG+ATiWaYbFvEG8dSmpXPeJ46woqQQnxOPGnRB4keuyy6/cS447OeZESOdmieOEAuFNpbbmBUNlXiSOKqoGuX7My4rnLc4q+Uqa96TvzCU01aWuU5zEAksYgkiBMioooQyLMRo1UgxkaL9uId/wPGL5JLJVQIjxwIqUCE5fvA/+N2tmZ8Yd5NCcaDzxbY/hoGuXaBRs+3vY9tunACBZ+BKa/krdWD6k/RaS4seAb3bwMV1S5P3gMsdoP9JlwzJkQI0/fk88H5G35QFwrdA95rbW3Mfpw9AmrpK3gAHh8BIgbLXPd4dbO/t3zPN/n4Ax9dyyerighsAAAAGYktHRAAAAAAAAPlDu38AAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfmCBMVNCYN3/YeAAAA/UlEQVQ4y7WTQUoDQRBFf01czlJcxUyOINGjjAvFHMFzZGdygOwDwTtk6UZcqLlAxCAuMigug89FamIzdAIN+qGhq/6v6qrqbumvAJwBj8AHMAQs4DJgBHy65jSW4Bl4AaZsUAbcufumrnmquSzIcSzpTtLA7XbA1fuBa9qxCob8YgUUAdcFqoC/iSXIgLELOhG+49w4nM+2BTP7ljR3M4/MufbNzYxdN1E0Sm2ialZnsVIllZKOJF24eyLpXdKtmS1S3sYMmO3THOwJziUdbrbkZvaVcnILeAh6vweylAQ9D7z2BXCS0sJS0lrSpdtrSW+pn6sPLIFX4Er/hR9C0wl1FTBzNwAAAABJRU5ErkJggg==)](https://github.com/PurpurMC/Purpur/network/members)
1616
[![Watchers](https://img.shields.io/github/watchers/PurpurMC/Purpur?label=watchers&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9bxSIVh1YQcYhQnSyIiuimVShChVArtOpgcukXNGlIUlwcBdeCgx+LVQcXZ10dXAVB8APE0clJ0UVK/F9SaBHjwXE/3t173L0D/PUyU82OMUDVLCOViAuZ7KrQ9YogwujDEGYkZupzopiE5/i6h4+vdzGe5X3uz9Gj5EwG+ATiWaYbFvEG8dSmpXPeJ46woqQQnxOPGnRB4keuyy6/cS447OeZESOdmieOEAuFNpbbmBUNlXiSOKqoGuX7My4rnLc4q+Uqa96TvzCU01aWuU5zEAksYgkiBMioooQyLMRo1UgxkaL9uId/wPGL5JLJVQIjxwIqUCE5fvA/+N2tmZ8Yd5NCcaDzxbY/hoGuXaBRs+3vY9tunACBZ+BKa/krdWD6k/RaS4seAb3bwMV1S5P3gMsdoP9JlwzJkQI0/fk88H5G35QFwrdA95rbW3Mfpw9AmrpK3gAHh8BIgbLXPd4dbO/t3zPN/n4Ax9dyyerighsAAAAGYktHRAAAAAAAAPlDu38AAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfmCBMVNw4TRw0nAAAA3UlEQVQ4y83SP04CURAG8I0lewHOwAFUaiwkdmAlp8CL4FHopfIvtOIJWE3opIBK489mQPKy6xYWOskkL9/MN/PNzMuyf2fIcYkZVuGzwPI68gle8Yl7jMIfAntBp4o8wAeecFgSP8I8cgZp8DwC12j8oLCBCd7R34ItbHCzT8ZZSC7QTYrcYo1WhjGWaCbdCt+2SGLN4IwPfnu07QjrkhG6oWKB0+TMd7sRAuzHYuqWmO8tsVd1xjmOS8htPEfORVWHTmweHnEVPg2sqPxIicxhFFjhLd7D2q/8J/YFHSJt9VSqQ08AAAAASUVORK5CYII=)](https://github.com/PurpurMC/Purpur/watchers)
1717

18-
Purpur is a drop-in replacement for [Paper](https://github.com/PaperMC/Paper) servers designed for configurability, new fun and exciting gameplay features, and performance built on top of [Paper](https://github.com/PaperMC/Paper/).
18+
Purpur is a drop-in replacement for [Spigot](https://github.com/SpigotMC/Spigot) servers designed for configurability, new fun and exciting gameplay features, and performance built on top of [Spigot](https://github.com/SpigotMC/Spigot).
1919

2020
</div>
2121

@@ -44,7 +44,7 @@ All patches are licensed under the MIT license, unless otherwise noted in the pa
4444

4545
[![MIT License](https://img.shields.io/github/license/PurpurMC/Purpur?&logo=github)](LICENSE)
4646

47-
See [PaperMC/Paper](https://github.com/PaperMC/Paper), and [PaperMC/Paperweight](https://github.com/PaperMC/paperweight) for the license of material used by this project.
47+
See [SpigotMC/Spigot](https://github.com/SpigotMC/Spigot), and [PaperMC/Paperweight](https://github.com/PaperMC/paperweight) for the license of material used by this project.
4848

4949
## bStats
5050

@@ -84,7 +84,7 @@ dependencies {
8484
}
8585
```
8686

87-
Yes, this also includes all API provided by Paper, Spigot, and Bukkit.
87+
Yes, this also includes all API provided by Spigot and Bukkit.
8888

8989
## Building and setting up
9090

build.gradle.kts

+10-10
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@ plugins {
66
id("io.papermc.paperweight.patcher") version "2.0.0-beta.16"
77
}
88

9-
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
9+
val spigotMavenPublicUrl = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
1010

1111
paperweight {
12-
upstreams.paper {
13-
ref = providers.gradleProperty("paperCommit")
12+
upstreams.spigot {
13+
ref = providers.gradleProperty("spigotCommit")
1414

1515
patchFile {
16-
path = "paper-server/build.gradle.kts"
16+
path = "spigot-server/build.gradle.kts"
1717
outputFile = file("purpur-server/build.gradle.kts")
1818
patchFile = file("purpur-server/build.gradle.kts.patch")
1919
}
2020
patchFile {
21-
path = "paper-api/build.gradle.kts"
21+
path = "spigot-api/build.gradle.kts"
2222
outputFile = file("purpur-api/build.gradle.kts")
2323
patchFile = file("purpur-api/build.gradle.kts.patch")
2424
}
25-
patchDir("paperApi") {
26-
upstreamPath = "paper-api"
25+
patchDir("spigotApi") {
26+
upstreamPath = "spigot-api"
2727
excludes = setOf("build.gradle.kts")
28-
patchesDir = file("purpur-api/paper-patches")
29-
outputDir = file("paper-api")
28+
patchesDir = file("purpur-api/spigot-patches")
29+
outputDir = file("spigot-api")
3030
}
3131
}
3232
}
@@ -66,7 +66,7 @@ subprojects {
6666

6767
repositories {
6868
mavenCentral()
69-
maven(paperMavenPublicUrl)
69+
maven(spigotMavenPublicUrl)
7070
maven("https://jitpack.io")
7171
}
7272

purpur-api/build.gradle.kts.patch

+6-30
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,18 @@
1-
--- a/paper-api/build.gradle.kts
2-
+++ b/paper-api/build.gradle.kts
1+
--- a/spigot-api/build.gradle.kts
2+
+++ b/spigot-api/build.gradle.kts
33
@@ -93,7 +_,7 @@
44
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
55
}
66

7-
-val generatedDir: java.nio.file.Path = layout.projectDirectory.dir("src/generated/java").asFile.toPath()
8-
+val generatedDir: java.nio.file.Path = rootProject.layout.projectDirectory.dir("paper-api/src/generated/java").asFile.toPath()
9-
idea {
10-
module {
11-
generatedSourceDirs.add(generatedDir.toFile())
12-
@@ -103,6 +_,18 @@
13-
main {
14-
java {
15-
srcDir(generatedDir)
16-
+ srcDir(file("../paper-api/src/main/java"))
17-
+ }
18-
+ resources {
19-
+ srcDir(file("../paper-api/src/main/resources"))
20-
+ }
21-
+ }
22-
+ test {
23-
+ java {
24-
+ srcDir(file("../paper-api/src/test/java"))
25-
+ }
26-
+ resources {
27-
+ srcDir(file("../paper-api/src/test/resources"))
28-
}
29-
}
30-
}
317
@@ -168,8 +_,10 @@
328
val services = objects.newInstance<Services>()
339

3410
tasks.withType<Javadoc> {
3511
+ //(options as StandardJavadocDocletOptions).addStringOption("-add-modules", "jdk.incubator.vector") // Purpur - our javadocs need this for pufferfish's SIMD patch
36-
+ (options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet") // Purpur - silence Paper's bajillion javadoc warnings
12+
+ (options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet") // Purpur - silence Spigot's bajillion javadoc warnings
3713
val options = options as StandardJavadocDocletOptions
3814
- options.overview = "src/main/javadoc/overview.html"
39-
+ options.overview = "../paper-api/src/main/javadoc/overview.html"
15+
+ options.overview = "../spigot-api/src/main/javadoc/overview.html"
4016
options.use()
4117
options.isDocFilesSubDirs = true
4218
options.links(
@@ -45,12 +21,12 @@
4521

4622
// workaround for https://github.com/gradle/gradle/issues/4046
4723
- inputs.dir("src/main/javadoc").withPropertyName("javadoc-sourceset")
48-
+ inputs.dir("../paper-api/src/main/javadoc").withPropertyName("javadoc-sourceset")
24+
+ inputs.dir("../spigot-api/src/main/javadoc").withPropertyName("javadoc-sourceset")
4925
val fsOps = services.fileSystemOperations
5026
doLast {
5127
fsOps.copy {
5228
- from("src/main/javadoc") {
53-
+ from("../paper-api/src/main/javadoc") {
29+
+ from("../spigot-api/src/main/javadoc") {
5430
include("**/doc-files/**")
5531
}
5632
into("build/docs/javadoc")

purpur-api/paper-patches/features/0001-Rebrand.patch

-23
This file was deleted.

purpur-api/paper-patches/files/src/generated/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java.patch

-29
This file was deleted.

purpur-api/paper-patches/files/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java.patch

-15
This file was deleted.

purpur-api/paper-patches/files/src/main/java/org/bukkit/command/defaults/VersionCommand.java.patch

-26
This file was deleted.

purpur-api/paper-patches/features/0002-Purpur-config-files.patch renamed to purpur-api/spigot-patches/features/0002-Purpur-config-files.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ index 53ad1696d02afbebf27663dd753fa93e41cfeb4e..cec387842895d617b0dcf9158f080fe0
99
--- a/src/main/java/org/bukkit/Server.java
1010
+++ b/src/main/java/org/bukkit/Server.java
1111
@@ -2369,6 +2369,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
12+
throw new UnsupportedOperationException("Not supported yet.");
1213
}
13-
// Paper end
1414

1515
+ // Purpur start
1616
+ @NotNull

purpur-api/paper-patches/files/src/main/java/co/aikar/timings/Timing.java.patch renamed to purpur-api/spigot-patches/files/src/main/java/co/aikar/timings/Timing.java.patch

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,45 @@
44
* @return Timing
55
*/
66
@NotNull
7-
+ @io.papermc.paper.annotation.DoNotUse // Purpur - Remove Timings
7+
+ @org.purpurmc.purpur.annotation.DoNotUse // Purpur - Remove Timings
88
Timing startTiming();
99

1010
/**
1111
@@ -46,6 +_,7 @@
1212
*
1313
* Will automatically be called when this Timing is used with try-with-resources
1414
*/
15-
+ @io.papermc.paper.annotation.DoNotUse // Purpur - Remove Timings
15+
+ @org.purpurmc.purpur.annotation.DoNotUse // Purpur - Remove Timings
1616
void stopTiming();
1717

1818
/**
1919
@@ -56,6 +_,7 @@
2020
* @return Timing
2121
*/
2222
@NotNull
23-
+ @io.papermc.paper.annotation.DoNotUse // Purpur - Remove Timings
23+
+ @org.purpurmc.purpur.annotation.DoNotUse // Purpur - Remove Timings
2424
Timing startTimingIfSync();
2525

2626
/**
2727
@@ -65,12 +_,14 @@
2828
*
2929
* But only if we are on the primary thread.
3030
*/
31-
+ @io.papermc.paper.annotation.DoNotUse // Purpur - Remove Timings
31+
+ @org.purpurmc.purpur.annotation.DoNotUse // Purpur - Remove Timings
3232
void stopTimingIfSync();
3333

3434
/**
3535
* @deprecated Doesn't do anything - Removed
3636
*/
3737
@Deprecated
38-
+ @io.papermc.paper.annotation.DoNotUse // Purpur - Remove Timings
38+
+ @org.purpurmc.purpur.annotation.DoNotUse // Purpur - Remove Timings
3939
void abort();
4040

4141
/**
4242
@@ -82,5 +_,6 @@
4343
TimingHandler getTimingHandler();
4444

4545
@Override
46-
+ @io.papermc.paper.annotation.DoNotUse // Purpur - Remove Timings
46+
+ @org.purpurmc.purpur.annotation.DoNotUse // Purpur - Remove Timings
4747
void close();
4848
}

purpur-api/paper-patches/files/src/main/java/org/bukkit/Material.java.patch renamed to purpur-api/spigot-patches/files/src/main/java/org/bukkit/Material.java.patch

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
--- a/src/main/java/org/bukkit/Material.java
22
+++ b/src/main/java/org/bukkit/Material.java
33
@@ -3616,4 +_,40 @@
4-
return this.asItemType().getDefaultDataTypes();
5-
}
6-
// Paper end - data component API
74
+
85
+ // Purpur start - ItemStack convenience methods
96
+ public boolean isArmor() {

0 commit comments

Comments
 (0)