Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@8f736dbf Improve outdated version check (#12589)
PaperMC/Paper@3ebc5b33 Don't apply oversized sanitizers in components disabled by config (#13466)
This commit is contained in:
granny
2026-01-03 18:30:46 -08:00
parent 631e6e7e13
commit 56a7d46279
9 changed files with 188 additions and 101 deletions

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Setting to reintroduce end void rings
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index c52d2530f6bfd601e8af8fd6713e6870cf5611d3..c95bca1a3100952fb02a7bff46fcf9155b185a80 100644
index e47f279b66b169e2cdf762bb739a261f2acebeb1..cc1906ef871de6a4ff82039d8ddfcd764139f37d 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -300,6 +300,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -303,6 +303,7 @@ public class GlobalConfiguration extends ConfigurationPart {
}
}
@@ -16,7 +16,7 @@ index c52d2530f6bfd601e8af8fd6713e6870cf5611d3..c95bca1a3100952fb02a7bff46fcf915
public Misc misc;
public class Misc extends ConfigurationPart {
@@ -346,6 +347,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -349,6 +350,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@Comment("Whether the nether dimension is enabled and will be loaded.")
public boolean enableNether = true;
@Comment("Keeps Paper's fix for MC-159283 enabled. Disable to use vanilla End ring terrain.")

View File

@@ -1,78 +0,0 @@
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
@@ -35,7 +_,10 @@
private static final Logger LOGGER = LogUtils.getClassLogger();
private static final int DISTANCE_ERROR = -1;
private static final int DISTANCE_UNKNOWN = -2;
- private static final String DOWNLOAD_PAGE = "https://papermc.io/downloads/paper";
+ // Purpur start - Rebrand
+ private static final String DOWNLOAD_PAGE = "https://purpurmc.org/downloads";
+ private static int distance = DISTANCE_UNKNOWN; public int distance() { return distance; }
+ // Purpur end - Rebrand
@Override
public long getCacheTime() {
@@ -49,7 +_,7 @@
if (build.buildNumber().isEmpty() && build.gitCommit().isEmpty()) {
updateMessage = text("You are running a development version without access to version information", color(0xFF5300));
} else {
- updateMessage = getUpdateStatusMessage("PaperMC/Paper", build);
+ updateMessage = getUpdateStatusMessage("PurpurMC/Purpur", build); // Purpur - Rebrand
}
final @Nullable Component history = this.getHistory();
@@ -57,7 +_,7 @@
}
private static Component getUpdateStatusMessage(final String repo, final ServerBuildInfo build) {
- int distance = DISTANCE_ERROR;
+ //int distance = DISTANCE_ERROR; // Purpur - use field - Rebrand
final OptionalInt buildNumber = build.buildNumber();
if (buildNumber.isPresent()) {
@@ -71,10 +_,10 @@
}
return switch (distance) {
- case DISTANCE_ERROR -> text("Error obtaining version information", NamedTextColor.YELLOW);
- case 0 -> text("You are running the latest version", NamedTextColor.GREEN);
- case DISTANCE_UNKNOWN -> text("Unknown version", NamedTextColor.YELLOW);
- default -> text("You are " + distance + " version(s) behind", NamedTextColor.YELLOW)
+ case DISTANCE_ERROR -> text("* Error obtaining version information", NamedTextColor.RED); // Purpur - Rebrand
+ case 0 -> text("* You are running the latest version", NamedTextColor.GREEN); // Purpur - Rebrand
+ case DISTANCE_UNKNOWN -> text("* Unknown version", NamedTextColor.YELLOW); // Purpur - Rebrand
+ default -> text("* You are " + distance + " version(s) behind", NamedTextColor.YELLOW) // Purpur - Rebrand
.append(Component.newline())
.append(text("Download the new version at: ")
.append(text(DOWNLOAD_PAGE, NamedTextColor.GOLD)
@@ -86,18 +_,15 @@
private static int fetchDistanceFromSiteApi(final ServerBuildInfo build, final int jenkinsBuild) {
try {
try (final BufferedReader reader = Resources.asCharSource(
- URI.create("https://api.papermc.io/v2/projects/paper/versions/" + build.minecraftVersionId()).toURL(),
+ URI.create("https://api.purpurmc.org/v2/purpur/" + build.minecraftVersionId()).toURL(), // Purpur - Rebrand
StandardCharsets.UTF_8
).openBufferedStream()) {
final JsonObject json = new Gson().fromJson(reader, JsonObject.class);
- final JsonArray builds = json.getAsJsonArray("builds");
- final int latest = StreamSupport.stream(builds.spliterator(), false)
- .mapToInt(JsonElement::getAsInt)
- .max()
- .orElseThrow();
+ //final JsonArray builds = json.getAsJsonArray("builds"); // Purpur - Rebrand
+ final int latest = json.getAsJsonObject("builds").getAsJsonPrimitive("latest").getAsInt(); // Purpur - Rebrand
return latest - jenkinsBuild;
} catch (final JsonSyntaxException ex) {
- LOGGER.error("Error parsing json from Paper's downloads API", ex);
+ LOGGER.error("Error parsing json from Purpur's downloads API", ex); // Purpur - Rebrand
return DISTANCE_ERROR;
}
} catch (final IOException e) {
@@ -141,6 +_,6 @@
return null;
}
- return text("Previous version: " + oldVersion, NamedTextColor.GRAY, TextDecoration.ITALIC);
+ return text("Previous: " + oldVersion, NamedTextColor.GRAY); // Purpur - Rebrand
}
}

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -164,6 +_,14 @@
@@ -162,6 +_,14 @@
.defaultsTo(new File[] {})
.describedAs("Jar file");
@@ -15,12 +15,3 @@
this.accepts("server-name", "Name of the server")
.withRequiredArg()
.ofType(String.class)
@@ -223,7 +_,7 @@
System.setProperty(net.minecrell.terminalconsole.TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper
}
- if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
+ if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { // Purpur - Disable outdated build check
Date buildDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(Main.class.getPackage().getImplementationVendor()); // Paper
Calendar deadline = Calendar.getInstance();

View File

@@ -0,0 +1,11 @@
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -487,7 +_,7 @@
@Override
public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
- return new com.destroystokyo.paper.PaperVersionFetcher();
+ return new org.purpurmc.purpur.PurpurVersionFetcher(); // Purpur - use old Paper version checker
}
@Override