Skip to content

Commit ab1d3b6

Browse files
committed
1.21.4 (hard fork) - api only, server wip
1 parent 987ba06 commit ab1d3b6

File tree

90 files changed

+2515
-18
lines changed

Some content is hidden

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

90 files changed

+2515
-18
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ build
66

77
/run
88

9-
/fork-server/build.gradle.kts
10-
/fork-server/src/minecraft
9+
/parchment-server/build.gradle.kts
10+
/parchment-server/src/minecraft
1111
/paper-server
12-
/fork-api/build.gradle.kts
12+
/parchment-api/build.gradle.kts
1313
/paper-api
1414
/paper-api-generator
1515

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Things I've found while just trying to get this to work:
2+
3+
- 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)
4+
- To create a file patch:
5+
- Make the changes you need and have no other staged changes
6+
- cd paper-api or paper-server
7+
- git add .
8+
- git commit --ammend
9+
- This ammends it to the specific 'File Patch Commit'
10+
- ./gradlew rebuildPaper<Api/Server>FilePatches

build.gradle.kts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ paperweight {
1212

1313
patchFile {
1414
path = "paper-server/build.gradle.kts"
15-
outputFile = file("fork-server/build.gradle.kts")
16-
patchFile = file("fork-server/build.gradle.kts.patch")
15+
outputFile = file("parchment-server/build.gradle.kts")
16+
patchFile = file("parchment-server/build.gradle.kts.patch")
1717
}
1818
patchFile {
1919
path = "paper-api/build.gradle.kts"
20-
outputFile = file("fork-api/build.gradle.kts")
21-
patchFile = file("fork-api/build.gradle.kts.patch")
20+
outputFile = file("parchment-api/build.gradle.kts")
21+
patchFile = file("parchment-api/build.gradle.kts.patch")
2222
}
2323
patchDir("paperApi") {
2424
upstreamPath = "paper-api"
2525
excludes = setOf("build.gradle.kts")
26-
patchesDir = file("fork-api/paper-patches")
26+
patchesDir = file("parchment-api/paper-patches")
2727
outputDir = file("paper-api")
2828
}
2929
patchDir("paperApiGenerator") {
3030
upstreamPath = "paper-api-generator"
31-
patchesDir = file("fork-api-generator/paper-patches")
31+
patchesDir = file("parchment-api-generator/paper-patches")
3232
outputDir = file("paper-api-generator")
3333
}
3434
}
@@ -49,6 +49,7 @@ subprojects {
4949
repositories {
5050
mavenCentral()
5151
maven(paperMavenPublicUrl)
52+
maven("https://sonatype.projecteden.gg/repository/maven-public/")
5253
}
5354

5455
dependencies {
@@ -80,12 +81,11 @@ subprojects {
8081

8182
extensions.configure<PublishingExtension> {
8283
repositories {
83-
/*
84-
maven("https://repo.papermc.io/repository/maven-snapshots/") {
85-
name = "paperSnapshots"
84+
maven {
85+
name = "edenSnapshots"
86+
url = uri("https://sonatype.projecteden.gg/repository/maven-snapshots/")
8687
credentials(PasswordCredentials::class)
8788
}
88-
*/
8989
}
9090
}
9191
}

gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
group=fork.test
1+
group=gg.projecteden.parchment
22
version=1.21.4-R0.1-SNAPSHOT
33
mcVersion=1.21.4
44
paperRef=b03d39b5ce6b5046ce6854ddba74e8ae3641c230
@@ -7,3 +7,5 @@ org.gradle.configuration-cache=true
77
org.gradle.caching=true
88
org.gradle.parallel=true
99
org.gradle.vfs.watch=false
10+
11+
edenVersion = 2.3.0-SNAPSHOT

parchment-api/build.gradle.kts.patch

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
--- a/paper-api/build.gradle.kts
22
+++ b/paper-api/build.gradle.kts
3+
@@ -15,6 +_,8 @@
4+
val slf4jVersion = "2.0.9"
5+
val log4jVersion = "2.17.1"
6+
7+
+val edenVersion: String by project // Parchment
8+
+
9+
val apiAndDocs: Configuration by configurations.creating {
10+
attributes {
11+
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
12+
@@ -39,6 +_,7 @@
13+
}
14+
15+
dependencies {
16+
+ api("gg.projecteden:eden-interfaces:$edenVersion") // Parchment
17+
18+
// api dependencies are listed transitively to API consumers
19+
api("com.google.guava:guava:33.3.1-jre")
320
@@ -103,6 +_,18 @@
421
main {
522
java {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java
2+
+++ b/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java
3+
@@ -13,7 +_,7 @@
4+
* Called when a beacon effect is being applied to a player.
5+
*/
6+
@NullMarked
7+
-public class BeaconEffectEvent extends BlockEvent implements Cancellable {
8+
+public class BeaconEffectEvent extends BlockEvent implements Cancellable, gg.projecteden.parchment.HasPlayer { // Parchment
9+
10+
private static final HandlerList HANDLER_LIST = new HandlerList();
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java
2+
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java
3+
@@ -38,7 +_,7 @@
4+
* at the Enderman, according to Vanilla rules.
5+
*/
6+
@NullMarked
7+
-public class EndermanAttackPlayerEvent extends EntityEvent implements Cancellable {
8+
+public class EndermanAttackPlayerEvent extends EntityEvent implements Cancellable, gg.projecteden.parchment.HasPlayer { // Parchment
9+
10+
private static final HandlerList HANDLER_LIST = new HandlerList();
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java
2+
+++ b/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java
3+
@@ -12,7 +_,7 @@
4+
* Fired when a Turtle lays eggs
5+
*/
6+
@NullMarked
7+
-public class TurtleLayEggEvent extends EntityEvent implements Cancellable {
8+
+public class TurtleLayEggEvent extends EntityEvent implements Cancellable, gg.projecteden.parchment.HasLocation { // Parchment
9+
10+
private static final HandlerList HANDLER_LIST = new HandlerList();
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java
2+
+++ b/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java
3+
@@ -12,7 +_,7 @@
4+
* Fired when a Turtle starts digging to lay eggs
5+
*/
6+
@NullMarked
7+
-public class TurtleStartDiggingEvent extends EntityEvent implements Cancellable {
8+
+public class TurtleStartDiggingEvent extends EntityEvent implements Cancellable, gg.projecteden.parchment.HasLocation { // Parchment
9+
10+
private static final HandlerList HANDLER_LIST = new HandlerList();
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java
2+
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java
3+
@@ -21,7 +_,7 @@
4+
* <p>WARNING: TAMPERING WITH THIS EVENT CAN BE DANGEROUS</p>
5+
*/
6+
@NullMarked
7+
-public class PlayerHandshakeEvent extends Event implements Cancellable {
8+
+public class PlayerHandshakeEvent extends Event implements Cancellable, gg.projecteden.api.interfaces.OptionalUniqueId { // Parchment
9+
10+
private static final HandlerList HANDLER_LIST = new HandlerList();
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--- a/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java
2+
+++ b/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java
3+
@@ -22,7 +_,7 @@
4+
* {@link Event#isAsynchronous()}
5+
*/
6+
@NullMarked
7+
-public class PreLookupProfileEvent extends Event {
8+
+public class PreLookupProfileEvent extends Event implements gg.projecteden.api.interfaces.OptionalUniqueId { // Parchment
9+
10+
private static final HandlerList HANDLER_LIST = new HandlerList();
11+
12+
@@ -52,6 +_,10 @@
13+
* @return The UUID of the profile if it has already been provided by a plugin
14+
*/
15+
public @Nullable UUID getUUID() {
16+
+ return this.uuid;
17+
+ }
18+
+
19+
+ public UUID getUniqueId() {
20+
return this.uuid;
21+
}
22+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java
2+
+++ b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java
3+
@@ -53,7 +_,7 @@
4+
* Only 1 process will be allowed to provide completions, the Async Event, or the standard process.
5+
*/
6+
@NullMarked
7+
-public class AsyncTabCompleteEvent extends Event implements Cancellable {
8+
+public class AsyncTabCompleteEvent extends Event implements Cancellable, gg.projecteden.parchment.OptionalLocation { // Parchment
9+
10+
private static final HandlerList HANDLER_LIST = new HandlerList();
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java
2+
+++ b/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java
3+
@@ -8,7 +_,7 @@
4+
/**
5+
* Thrown when an incoming plugin message channel throws an exception
6+
*/
7+
-public class ServerPluginMessageException extends ServerPluginException {
8+
+public class ServerPluginMessageException extends ServerPluginException implements gg.projecteden.parchment.HasPlayer { // Parchment
9+
10+
private final Player player;
11+
private final String channel;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/src/main/java/io/papermc/paper/event/packet/PlayerChunkLoadEvent.java
2+
+++ b/src/main/java/io/papermc/paper/event/packet/PlayerChunkLoadEvent.java
3+
@@ -16,7 +_,7 @@
4+
* Not intended for modifying server side state.
5+
*/
6+
@NullMarked
7+
-public class PlayerChunkLoadEvent extends ChunkEvent {
8+
+public class PlayerChunkLoadEvent extends ChunkEvent implements gg.projecteden.parchment.HasPlayer { // Parchment
9+
10+
private static final HandlerList HANDLER_LIST = new HandlerList();
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/src/main/java/io/papermc/paper/event/packet/PlayerChunkUnloadEvent.java
2+
+++ b/src/main/java/io/papermc/paper/event/packet/PlayerChunkUnloadEvent.java
3+
@@ -14,7 +_,7 @@
4+
* Not intended for modifying server side.
5+
*/
6+
@NullMarked
7+
-public class PlayerChunkUnloadEvent extends ChunkEvent {
8+
+public class PlayerChunkUnloadEvent extends ChunkEvent implements gg.projecteden.parchment.HasPlayer { // Parchment
9+
10+
private static final HandlerList HANDLER_LIST = new HandlerList();
11+
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
--- a/src/main/java/org/bukkit/ChatColor.java
2+
+++ b/src/main/java/org/bukkit/ChatColor.java
3+
@@ -13,7 +_,7 @@
4+
* @deprecated ChatColor has been deprecated in favor of <a href="https://docs.advntr.dev/text.html">Adventure</a> API. See {@link net.kyori.adventure.text.format.NamedTextColor} for the adventure equivalent of pre-defined text colors
5+
*/
6+
@Deprecated // Paper
7+
-public enum ChatColor {
8+
+public enum ChatColor implements net.kyori.adventure.text.format.StyleBuilderApplicable, net.kyori.adventure.text.format.TextFormat { // Parchment
9+
/**
10+
* Represents black
11+
*/
12+
@@ -183,6 +_,13 @@
13+
public net.md_5.bungee.api.ChatColor asBungee() {
14+
return net.md_5.bungee.api.ChatColor.MAGIC;
15+
}
16+
+
17+
+ // Parchment start
18+
+ @Override
19+
+ public void styleApply(net.kyori.adventure.text.format.Style.@NotNull Builder style) {
20+
+ style.apply(net.kyori.adventure.text.format.TextDecoration.OBFUSCATED);
21+
+ }
22+
+ // Parchment end
23+
},
24+
/**
25+
* Makes the text bold.
26+
@@ -213,6 +_,13 @@
27+
public net.md_5.bungee.api.ChatColor asBungee() {
28+
return net.md_5.bungee.api.ChatColor.UNDERLINE;
29+
}
30+
+
31+
+ // Parchment start
32+
+ @Override
33+
+ public void styleApply(net.kyori.adventure.text.format.Style.@NotNull Builder style) {
34+
+ style.apply(net.kyori.adventure.text.format.TextDecoration.UNDERLINED);
35+
+ }
36+
+ // Parchment end
37+
},
38+
/**
39+
* Makes the text italic.
40+
@@ -233,6 +_,16 @@
41+
public net.md_5.bungee.api.ChatColor asBungee() {
42+
return net.md_5.bungee.api.ChatColor.RESET;
43+
}
44+
+
45+
+ // Parchment start
46+
+ @Override
47+
+ public void styleApply(net.kyori.adventure.text.format.Style.@NotNull Builder style) {
48+
+ style.color(null);
49+
+ for (net.kyori.adventure.text.format.TextDecoration decoration : net.kyori.adventure.text.format.TextDecoration.values()) {
50+
+ style.decoration(decoration, net.kyori.adventure.text.format.TextDecoration.State.NOT_SET);
51+
+ }
52+
+ }
53+
+ // Parchment end
54+
};
55+
56+
/**
57+
@@ -264,6 +_,16 @@
58+
public net.md_5.bungee.api.ChatColor asBungee() {
59+
return net.md_5.bungee.api.ChatColor.RESET;
60+
};
61+
+
62+
+ // Parchment start
63+
+ @Override
64+
+ public void styleApply(net.kyori.adventure.text.format.Style.@NotNull Builder style) {
65+
+ if (isColor())
66+
+ style.color(net.kyori.adventure.text.format.TextColor.color(asBungee().getColor().getRGB()));
67+
+ else
68+
+ style.decorate(net.kyori.adventure.text.format.TextDecoration.valueOf(name()));
69+
+ }
70+
+ // Parchment end
71+
72+
/**
73+
* Gets the char value associated with this color
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--- a/src/main/java/org/bukkit/Color.java
2+
+++ b/src/main/java/org/bukkit/Color.java
3+
@@ -17,7 +_,7 @@
4+
* but subject to change.
5+
*/
6+
@SerializableAs("Color")
7+
-public final class Color implements ConfigurationSerializable {
8+
+public final class Color implements ConfigurationSerializable, net.kyori.adventure.text.format.TextColor { // Parchment
9+
private static final int BIT_MASK = 0xff;
10+
private static final int DEFAULT_ALPHA = 255;
11+
12+
@@ -309,6 +_,13 @@
13+
public int asARGB() {
14+
return getAlpha() << 24 | getRed() << 16 | getGreen() << 8 | getBlue();
15+
}
16+
+
17+
+ // Parchment start
18+
+ @Override
19+
+ public int value() {
20+
+ return asRGB();
21+
+ }
22+
+ // Parchment end
23+
24+
/**
25+
* Gets the color as an BGR integer.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
--- a/src/main/java/org/bukkit/DyeColor.java
2+
+++ b/src/main/java/org/bukkit/DyeColor.java
3+
@@ -8,7 +_,7 @@
4+
/**
5+
* All supported color values for dyes and cloth
6+
*/
7+
-public enum DyeColor {
8+
+public enum DyeColor implements net.kyori.adventure.util.RGBLike, net.kyori.adventure.text.format.StyleBuilderApplicable { // Parchment
9+
10+
/**
11+
* Represents white dye.
12+
@@ -134,6 +_,28 @@
13+
public Color getFireworkColor() {
14+
return firework;
15+
}
16+
+
17+
+ // Parchment start
18+
+ @Override
19+
+ public @org.jetbrains.annotations.Range(from = 0L, to = 255L) int red() {
20+
+ return color.getRed();
21+
+ }
22+
+
23+
+ @Override
24+
+ public @org.jetbrains.annotations.Range(from = 0L, to = 255L) int green() {
25+
+ return color.getGreen();
26+
+ }
27+
+
28+
+ @Override
29+
+ public @org.jetbrains.annotations.Range(from = 0L, to = 255L) int blue() {
30+
+ return color.getBlue();
31+
+ }
32+
+
33+
+ @Override
34+
+ public void styleApply(net.kyori.adventure.text.format.Style.@org.jetbrains.annotations.NotNull Builder style) {
35+
+ style.color(net.kyori.adventure.text.format.TextColor.color(color));
36+
+ }
37+
+ // Parchment end
38+
39+
/**
40+
* Gets the DyeColor with the given wool data value.

0 commit comments

Comments
 (0)