Skip to content

Commit

Permalink
Updated Upstream (Paper & Pufferfish)
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@44ee1cd fix recipe packet limiter (#9841)
PaperMC/Paper@e57af7d sync netty version with vanilla (#9842)

Pufferfish Changes:
pufferfish-gg/Pufferfish@0020a8b Port a patch from upstream
pufferfish-gg/Pufferfish@979d3a2 Update upstream (last 1.20.1)
pufferfish-gg/Pufferfish@06262c1 Initial 1.20.2 update
  • Loading branch information
granny committed Oct 16, 2023
1 parent ff126d3 commit 0458d84
Show file tree
Hide file tree
Showing 307 changed files with 852 additions and 896 deletions.
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.20.2-R0.1-SNAPSHOT

mcVersion = 1.20.2
paperCommit = 852c1c236d080d9fd907a5f4fd3e850437996aa2
paperCommit = e57af7d01e509c747520cc1037169029256289bf

org.gradle.caching = true
org.gradle.parallel = true
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,21 @@ Date: Sun, 12 Jun 2022 09:18:57 -0500
Subject: [PATCH] Fix pufferfish issues


diff --git a/build.gradle.kts b/build.gradle.kts
index 57739f9dd7d045d1a585a9fc1be290a1a007db6a..f8b27b3992f1d59bf0e95bba0961540e88345754 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -229,5 +229,7 @@ val runtimeClasspathForRunDev = sourceSets.main.flatMap { src ->
}
tasks.registerRunTask("runDev") {
description = "Spin up a non-relocated Mojang-mapped test server"
- classpath(sourceSets.main.map { it.runtimeClasspath })
+ classpath(tasks.filterProjectDir.flatMap { it.outputJar })
+ classpath(runtimeClasspathForRunDev)
+ jvmArgs("-DPaper.isRunDev=true")
}
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
index 0dd3374468e05f7a312ba5856b9cf8a4787dfa59..960c0555a001fe63de78d77d5ea47d08a520d029 100644
index cc66657cb4f978aa2df3ca1be6c683759952cc7a..26f08b7fb16484c39135ed172c246f76c9e089c7 100644
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
@@ -224,7 +224,7 @@ public class PufferfishConfig {
Expand All @@ -27,10 +40,10 @@ index 0dd3374468e05f7a312ba5856b9cf8a4787dfa59..960c0555a001fe63de78d77d5ea47d08
"This can improve performance by a few percent, but has minor gameplay implications.");
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index eac31c3fcc9161711328588ac852fcae1116d8ef..dbb59969cf55eda997588f4c3ef7dc899ea619bb 100644
index c1b03e4c37ea85ddf283479682d0eb2eca57ee3c..cf2fd8eba6aa4cf15cac924577507a700f7f72b5 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -948,7 +948,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -976,7 +976,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
// Paper start - optimise random block ticking
private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos();
Expand All @@ -40,23 +53,23 @@ index eac31c3fcc9161711328588ac852fcae1116d8ef..dbb59969cf55eda997588f4c3ef7dc89

private int currentIceAndSnowTick = 0; protected void resetIceAndSnowTick() { this.currentIceAndSnowTick = this.randomTickRandom.nextInt(16); } // Pufferfish
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 30d8ec75203adc677e5fb91d9538baf52a0684ad..5eca99fbd23ff0d35607bd185b011d6f9a30d0f0 100644
index 1e2620338f0b6fd1c160a8f8d6b659e273f2f1c9..6c0e33323922de72dcb941a10883a07c72808b5f 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -273,7 +273,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -210,7 +210,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {

public abstract ResourceKey<LevelStem> getTypeKey();

- protected final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(java.util.concurrent.ThreadLocalRandom.current().nextLong()); public net.minecraft.util.RandomSource getThreadUnsafeRandom() { return this.randomTickRandom; } // Pufferfish - move thread unsafe random initialization // Pufferfish - getter
+ //protected final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(java.util.concurrent.ThreadLocalRandom.current().nextLong()); public net.minecraft.util.RandomSource getThreadUnsafeRandom() { return this.randomTickRandom; } // Pufferfish - move thread unsafe random initialization // Pufferfish - getter // Purpur - dont break ABI

// Pufferfish start - ensure these get inlined
private final int minBuildHeight, minSection, height, maxBuildHeight, maxSection;
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 3eeb1f0eac76efe9b7c24f6d5787018c7842d07a..dbb0593a6feb60216379bde6720ca16f3ca827ae 100644
index 7edc6f1e642d01299117680edc79c67225c2053c..2d4586859bd19a5094619d8abd62e466b822d293 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -125,7 +125,7 @@ public class LevelChunk extends ChunkAccess {
@@ -126,7 +126,7 @@ public class LevelChunk extends ChunkAccess {
this.blockTicks = blockTickScheduler;
this.fluidTicks = fluidTickScheduler;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,29 @@ Subject: [PATCH] Rebrand


diff --git a/build.gradle.kts b/build.gradle.kts
index c187641f0ec6444a10e0e1583e1697d07e8f0267..9511ffbc88a374c4c7945da79af42433fd532d8c 100644
index f8b27b3992f1d59bf0e95bba0961540e88345754..e372110a189857056e4fae3cd1d996ce8cb69493 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
@@ -13,12 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
val alsoShade: Configuration by configurations.creating

dependencies {
- implementation(project(":paper-api"))
- implementation(project(":paper-mojangapi"))
- implementation(project(":pufferfish-api")) // Pufferfish // Paper
- // Pufferfish start
- implementation("io.papermc.paper:paper-mojangapi:1.19.2-R0.1-SNAPSHOT") {
+ // Purpur start
+ implementation(project(":purpur-api"))
+ implementation("io.papermc.paper:paper-mojangapi:${project.version}") {
+ exclude("io.papermc.paper", "paper-api")
+ }
exclude("io.papermc.paper", "paper-api")
}
- // Pufferfish end
+ // Purpur end
// Paper start
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0")
@@ -52,6 +56,10 @@ dependencies {
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
@@ -63,6 +63,10 @@ dependencies {
}
// Pufferfish end

+ implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur
+ implementation("org.mozilla:rhino-engine:1.7.14") // Purpur
Expand All @@ -34,16 +36,16 @@ index c187641f0ec6444a10e0e1583e1697d07e8f0267..9511ffbc88a374c4c7945da79af42433
testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
testImplementation("org.hamcrest:hamcrest:2.2")
@@ -72,7 +80,7 @@ tasks.jar {
@@ -89,7 +93,7 @@ tasks.jar {
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit",
- "Implementation-Version" to "git-Paper-$implementationVersion",
+ "Implementation-Version" to "git-Purpur-$implementationVersion", // Purpur
- "Implementation-Version" to "git-Pufferfish-$implementationVersion", // Pufferfish
+ "Implementation-Version" to "git-Purpur-$implementationVersion", // Pufferfish // Purpur
"Implementation-Vendor" to date, // Paper
"Specification-Title" to "Bukkit",
"Specification-Version" to project.version,
@@ -156,7 +164,7 @@ fun TaskContainer.registerRunTask(
@@ -173,7 +177,7 @@ fun TaskContainer.registerRunTask(
name: String,
block: JavaExec.() -> Unit
): TaskProvider<JavaExec> = register<JavaExec>(name) {
Expand Down Expand Up @@ -175,10 +177,10 @@ index 1d714d3eff11ed14f218656008190017494d4830..ed3527612315e6e0649182ce4e1ae283
stringbuilder.append(CrashReport.getErrorComment());
stringbuilder.append("\n\n");
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 97745f0bab8d82d397c6c2a5775aed92bca0a034..707a02804db563d94360b65d156c40be3aa30aeb 100644
index 371049c1236c6443384c0ce184e99d5b9f8e57c2..ebcd6c821379f4feb3b2c094266645ae552972db 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -908,7 +908,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -910,7 +910,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
shutdownThread = Thread.currentThread();
org.spigotmc.WatchdogThread.doStop(); // Paper
if (!isSameThread()) {
Expand All @@ -187,25 +189,25 @@ index 97745f0bab8d82d397c6c2a5775aed92bca0a034..707a02804db563d94360b65d156c40be
while (this.getRunningThread().isAlive()) {
this.getRunningThread().stop();
try {
@@ -1697,7 +1697,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1699,7 +1699,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

@DontObfuscate
public String getServerModName() {
- return "Paper"; // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
+ return "Purpur"; // Purpur - Purpur > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
- return "Pufferfish"; // Pufferfish - Pufferfish > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
+ return "Purpur"; // Purpur - Purpur > Pufferfish - Pufferfish > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
}

public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b7e7e6ed60f55d2ab5e4fcefb3638ad1768c3b7f..d69b765678f94eacf171841be47a8ff4f37fd405 100644
index 5a95dcc02241d6036ee520a6a7a05e8713c6081f..ff9a2122fa26a1238660dcb1bc64e3fc778ddd8d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -267,7 +267,7 @@ import javax.annotation.Nullable; // Paper
import javax.annotation.Nonnull; // Paper

public final class CraftServer implements Server {
- private final String serverName = "Paper"; // Paper
+ private final String serverName = "Purpur"; // Paper // Purpur
- private final String serverName = "Pufferfish"; // Paper // Pufferfish
+ private final String serverName = "Purpur"; // Paper // Pufferfish // Purpur
private final String serverVersion;
private final String bukkitVersion = Versioning.getBukkitVersion();
private final Logger logger = Logger.getLogger("Minecraft");
Expand Down Expand Up @@ -237,7 +239,7 @@ index 4e56018b64d11f76c8da43fd8f85c6de72204e36..9607675e6c5bff2183c4420d11fc63ee

@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index fe2124694eb080cab685a1ce1f6a66e2fcdf6a17..feb5f25886889710d51ab2a88192727c948322ca 100644
index daadfec2d86f7957072a639e1e36d4082448f35f..3579715faa33a722cccb13d8d7c86a3de740d6fc 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -912,7 +912,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
Expand All @@ -263,28 +265,28 @@ index d7ce4971d9271dbeff4adb9d852e4e7bdf60bf03..5a47a8785bc2e251d041f80a79295c43
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 806fb1064a1769d1251f2a2b04372275754d2aeb..717b1f797d28129a0f5c7c9c7b01691aa4f14317 100644
index 3298aac109e08da4801a6f08aa6f7acfc5e6bf16..33ea5172bb7fe1018bc39acc16963f4998ac52b2 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -462,7 +462,7 @@ public final class CraftMagicNumbers implements UnsafeValues {

@Override
public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
- return new com.destroystokyo.paper.PaperVersionFetcher();
+ return new com.destroystokyo.paper.PaperVersionFetcher(); // Purpur - TODO: Pufferfish
- return new gg.pufferfish.pufferfish.PufferfishVersionFetcher(); // Pufferfish
+ return new com.destroystokyo.paper.PaperVersionFetcher(); // Pufferfish // Purpur
}

@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
index 774556a62eb240da42e84db4502e2ed43495be17..fb87620c742ff7912f5e8ccd2a7930dd605576d9 100644
index 80553face9c70c2a3d897681e7761df85b22d464..99597258e8e88cd9e2c901c4ac3ff7faeeabee2b 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
@@ -11,7 +11,7 @@ public final class Versioning {
public static String getBukkitVersion() {
String result = "Unknown-Version";

- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/io.papermc.paper/paper-api/pom.properties");
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Purpur
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/gg.pufferfish.pufferfish/pufferfish-api/pom.properties"); // Pufferfish
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Pufferfish // Purpur
Properties properties = new Properties();

if (stream != null) {
Expand Down
Loading

0 comments on commit 0458d84

Please sign in to comment.