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@3fc9358 Show stacktrace when modifyItemStack fails
PaperMC/Paper@f175193 Expose server build information (#10729)
  • Loading branch information
granny committed May 17, 2024
1 parent ba950ad commit 69d3bb4
Show file tree
Hide file tree
Showing 71 changed files with 246 additions and 219 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.6-R0.1-SNAPSHOT

mcVersion = 1.20.6
paperCommit = 2faa3b2f44c962ce7413e8e3d71e32786851d556
paperCommit = f17519338bc589c045e0b32bfc37e048b23544d5

org.gradle.caching = true
org.gradle.parallel = true
Expand Down
24 changes: 24 additions & 0 deletions patches/api/0001-Rebrand.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: granny <[email protected]>
Date: Thu, 16 May 2024 19:11:29 -0700
Subject: [PATCH] Rebrand


diff --git a/src/main/java/io/papermc/paper/ServerBuildInfo.java b/src/main/java/io/papermc/paper/ServerBuildInfo.java
index 9df9d09aa477d4cd3c496ba0933c816df1ef0964..7107eabf02d9d9b69d97c978ba421ad52031ec3f 100644
--- a/src/main/java/io/papermc/paper/ServerBuildInfo.java
+++ b/src/main/java/io/papermc/paper/ServerBuildInfo.java
@@ -18,6 +18,13 @@ public interface ServerBuildInfo {
*/
Key BRAND_PAPER_ID = Key.key("papermc", "paper");

+ // Purpur start
+ /**
+ * The brand id for Purpur.
+ */
+ Key BRAND_PURPUR_ID = Key.key("purpurmc", "purpur");
+ // Purpur end
+
/**
* Gets the {@code ServerBuildInfo}.
*
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Purpur config files


diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 30cbe3bdc7142769019765b03cc4fe1f9ba1ddb4..f5c3c1a0c11dd3518981ce3b86dba8ced8578d9c 100644
index c8595ffcfcbdd79794d464415287d46acef72b72..607ba7cb902d7053cb570d8f3676ecbadbe56daf 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2257,6 +2257,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Bring back server name


diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 5d1b55fdbcbe63f6b42b694d05211a3cc691a09d..54f11593f4acfb89623cf1fad58819e001505fd1 100644
index 71f1c361ebccbe83193c37ec3a90faa4085001c3..20f10b2cfb6f2b1ce7da61a15f7dc4a68b7c5cde 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2910,4 +2910,15 @@ public final class Bukkit {
@@ -2907,4 +2907,15 @@ public final class Bukkit {
public static Server.Spigot spigot() {
return server.spigot();
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Lagging threshold


diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 54f11593f4acfb89623cf1fad58819e001505fd1..215647d7f5cc8487d6a173bc0160fec6db1971eb 100644
index 20f10b2cfb6f2b1ce7da61a15f7dc4a68b7c5cde..07a79b10ef8b7fa6fd22fbb2652d35ffc9170bfb 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2920,5 +2920,14 @@ public final class Bukkit {
@@ -2917,5 +2917,14 @@ public final class Bukkit {
public static String getServerName() {
return server.getServerName();
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Added the ability to add combustible items


diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 215647d7f5cc8487d6a173bc0160fec6db1971eb..7bc4e5e9947ab646707a5c0b39c70c0cc6606bd8 100644
index 07a79b10ef8b7fa6fd22fbb2652d35ffc9170bfb..b99e7e0076448a8b81e3d2d75a451c76f01fc12d 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2929,5 +2929,24 @@ public final class Bukkit {
@@ -2926,5 +2926,24 @@ public final class Bukkit {
public static boolean isLagging() {
return server.isLagging();
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Debug Marker API


diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 7bc4e5e9947ab646707a5c0b39c70c0cc6606bd8..70ef8f63ab79e102cb4326c21cc344488f4fbdd3 100644
index b99e7e0076448a8b81e3d2d75a451c76f01fc12d..75fe3bdbd44440c7cbea45dbd248e260f322dbb2 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2948,5 +2948,89 @@ public final class Bukkit {
@@ -2945,5 +2945,89 @@ public final class Bukkit {
public static void removeFuel(@NotNull Material material) {
server.removeFuel(material);
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
211 changes: 107 additions & 104 deletions patches/server/0001-Rebrand.patch

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions patches/server/0002-Purpur-config-files.patch
Original file line number Diff line number Diff line change
Expand Up @@ -112,34 +112,34 @@ index b4ef3ad2c17168085372f1fe46809f02d9dfe74a..04f7f6743aabdca54892b2b155386f86
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);

diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 4f454c5d70e7333429557eb86e38e0f2c22af380..21cc03794429e66edc3b9f0a4ed98b66dbba078c 100644
index 2fa5507aa2153a05208077f9547c165a1099b5bb..97e7f9d08dd41630e8ebf610f23d5b37b820db1b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1038,6 +1038,7 @@ public final class CraftServer implements Server {
@@ -1033,6 +1033,7 @@ public final class CraftServer implements Server {

org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
this.console.paperConfigurations.reloadConfigs(this.console);
+ org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
for (ServerLevel world : this.console.getAllLevels()) {
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
@@ -1053,6 +1054,7 @@ public final class CraftServer implements Server {
@@ -1048,6 +1049,7 @@ public final class CraftServer implements Server {
}
}
world.spigotConfig.init(); // Spigot
+ world.purpurConfig.init(); // Purpur
}

Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
@@ -1069,6 +1071,7 @@ public final class CraftServer implements Server {
@@ -1064,6 +1066,7 @@ public final class CraftServer implements Server {
this.reloadData();
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
+ org.purpurmc.purpur.PurpurConfig.registerCommands(); // Purpur
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");

@@ -3039,6 +3042,18 @@ public final class CraftServer implements Server {
@@ -3034,6 +3037,18 @@ public final class CraftServer implements Server {
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
}

Expand All @@ -159,10 +159,10 @@ index 4f454c5d70e7333429557eb86e38e0f2c22af380..21cc03794429e66edc3b9f0a4ed98b66
public void restart() {
org.spigotmc.RestartCommand.restart();
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index c988afa496d25314451435eedd64079a0d87cef0..45a33086e1bb8a70e0fa01090731d27a0474da41 100644
index e02102280ed1dc300191d19bbca8f00e17701753..fe181ec5f8e968ff78e694f7a213c7aac718704c 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -175,6 +175,14 @@ public class Main {
@@ -176,6 +176,14 @@ public class Main {
.describedAs("Jar file");
// Paper end

Expand Down
4 changes: 2 additions & 2 deletions patches/server/0006-Ridables.patch
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ index 665e88b2dedf9d5bb50914d5f3d377f2d19f40b0..f70a80b496bd1498778e82fc221c3b1b
super(x, y, z);
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7483be7ff59e80aa6605dc19f18bb54473e3540e..e02ae9c2c510ff2564f46e6d6d69465d0c4dabed 100644
index 989de328a8dd26486d65245d2737d9789d936e8a..71f1f9a9a395b17398941a4bb35e2d143a62a1f5 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1764,6 +1764,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1761,6 +1761,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers
worldserver.updateLagCompensationTick(); // Paper - lag compensation
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0011-Bring-back-server-name.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ index 9d10cdacb3aed2c00dc60aeb6f2cbeb48905e21f..842f382de43df5d5c321422372ec30cc
public final boolean spawnNpcs = this.get("spawn-npcs", true);
public final boolean pvp = this.get("pvp", true);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 21cc03794429e66edc3b9f0a4ed98b66dbba078c..fb430d21889e90597160fc11b0d0bc59b6b85ffc 100644
index 97e7f9d08dd41630e8ebf610f23d5b37b820db1b..7edceb03bf1db24892dd311c31edb75a223011f0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -3284,4 +3284,11 @@ public final class CraftServer implements Server {
@@ -3279,4 +3279,11 @@ public final class CraftServer implements Server {
return this.potionBrewer;
}
// Paper end
Expand Down
12 changes: 6 additions & 6 deletions patches/server/0012-Configurable-server-mod-name.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ Subject: [PATCH] Configurable server mod name


diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index e02ae9c2c510ff2564f46e6d6d69465d0c4dabed..27a1948b97f5a20b64849ebda7b485b229ed7bce 100644
index 71f1f9a9a395b17398941a4bb35e2d143a62a1f5..537726b345038e045172a42464ea166353515868 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1927,7 +1927,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1924,7 +1924,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

@DontObfuscate
public String getServerModName() {
- return "Purpur"; // Purpur - Purpur > // Pufferfish > // Paper
+ return org.purpurmc.purpur.PurpurConfig.serverModName; // Purpur - Purpur > // Pufferfish > // Paper
- return io.papermc.paper.ServerBuildInfo.buildInfo().brandName(); // Paper
+ return org.purpurmc.purpur.PurpurConfig.serverModName; // Paper // Purpur
}

public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index d2f3e864aa4d1c5d3ee8bb8f1e36787b1ca45f2e..1701580d6f09cab9088db28254afd70a63dee7fb 100644
index d2f3e864aa4d1c5d3ee8bb8f1e36787b1ca45f2e..fdf726c455f9a4de822644c703de7ffeab6b3702 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -188,6 +188,11 @@ public class PurpurConfig {
afkTabListSuffix = MiniMessage.miniMessage().serialize(MiniMessage.miniMessage().deserialize(getString("settings.messages.afk-tab-list-suffix", afkTabListSuffix)));
}

+ public static String serverModName = "Purpur";
+ public static String serverModName = io.papermc.paper.ServerBuildInfo.buildInfo().brandName();
+ private static void serverModName() {
+ serverModName = getString("settings.server-mod-name", serverModName);
+ }
Expand Down
12 changes: 6 additions & 6 deletions patches/server/0013-Lagging-threshold.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ Subject: [PATCH] Lagging threshold


diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 27a1948b97f5a20b64849ebda7b485b229ed7bce..d55adf4db46c89d9ce387036856ebb0305cbc412 100644
index 537726b345038e045172a42464ea166353515868..5aabb74e0fd49a7ab97d324f9fa7bfc26527af00 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -315,6 +315,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -312,6 +312,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files
public static long currentTickLong = 0L; // Paper - track current tick as a long
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
+ public boolean lagging = false; // Purpur

public volatile Thread shutdownThread; // Paper
public volatile boolean abnormalExit = false; // Paper
@@ -1217,6 +1218,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1214,6 +1215,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.recentTps[0] = tps1.getAverage();
this.recentTps[1] = tps5.getAverage();
this.recentTps[2] = tps15.getAverage();
Expand All @@ -25,10 +25,10 @@ index 27a1948b97f5a20b64849ebda7b485b229ed7bce..d55adf4db46c89d9ce387036856ebb03
}
// Paper end - further improve server tick loop
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index fb430d21889e90597160fc11b0d0bc59b6b85ffc..02a99cf58886ca2538208b53256905c181cce733 100644
index 7edceb03bf1db24892dd311c31edb75a223011f0..8e8f6e8f867b9dd63b91a91342629ba40e8e7374 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -3290,5 +3290,10 @@ public final class CraftServer implements Server {
@@ -3285,5 +3285,10 @@ public final class CraftServer implements Server {
public String getServerName() {
return this.getProperties().serverName;
}
Expand All @@ -40,7 +40,7 @@ index fb430d21889e90597160fc11b0d0bc59b6b85ffc..02a99cf58886ca2538208b53256905c1
// Purpur end
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 1701580d6f09cab9088db28254afd70a63dee7fb..876a4ea0beeae5baca62822eec2e18a4cf3ef09b 100644
index fdf726c455f9a4de822644c703de7ffeab6b3702..f80414b9bb7fb1f2849749481209648516fb28fb 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -193,6 +193,11 @@ public class PurpurConfig {
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0020-Disable-outdated-build-check.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Disable outdated build check


diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 66a3b28d7b943d443ff66fdcfbce6e5260b9463e..222865a3cee62f244a566092a7d814efe478ee01 100644
index fe181ec5f8e968ff78e694f7a213c7aac718704c..6d8e9cf4ee496b8748654e792ce438f512c3d946 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -302,7 +302,7 @@ public class Main {
@@ -303,7 +303,7 @@ public class Main {
System.setProperty(net.minecrell.terminalconsole.TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper
}

Expand Down
6 changes: 3 additions & 3 deletions patches/server/0043-Configurable-TPS-Catchup.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable TPS Catchup


diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index d55adf4db46c89d9ce387036856ebb0305cbc412..bdd0cc746315a9b8bbee53bdbca298cf8aaf6b2d 100644
index 5aabb74e0fd49a7ab97d324f9fa7bfc26527af00..709d594d35848d248a195e20f73972d26dcac7c1 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1242,6 +1242,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1239,6 +1239,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.popPush("nextTickWait");
this.mayHaveDelayedTasks = true;
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + i, this.nextTickTimeNanos);
Expand All @@ -22,7 +22,7 @@ index d55adf4db46c89d9ce387036856ebb0305cbc412..bdd0cc746315a9b8bbee53bdbca298cf
this.waitUntilNextTick();
this.finishMeasuringTaskExecutionTime();
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 3e7a8ab8ec3ea404f38caf1fe18f5b17f0284a21..16a52b5875934e3817dda26589b7443d614bc6ff 100644
index 321a10764b2a0787a49d7b8948e40cfe0a73f591..29d7c792277ff17f5119cf391c4fe4b86797adf0 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -248,4 +248,9 @@ public class PurpurConfig {
Expand Down
Loading

0 comments on commit 69d3bb4

Please sign in to comment.