9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00

Updated Upstream (Paper/Gale/Purpur)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@681c013 Bundle spark (#11093)
PaperMC/Paper@5fee9c6 Move configuration option to a system property
PaperMC/Paper@aa3b356 Improve server startup logging (#11110)
PaperMC/Paper@9aea240 Properly lookup plugin classes when looked up by spark
PaperMC/Paper@7e91a2c Update the bundled spark version

Gale Changes:
Dreeam-qwq/Gale@a4ed885 Updated Upstream (Paper)
Dreeam-qwq/Gale@3932464 [ci skip] Remove TODOs

Purpur Changes:
PurpurMC/Purpur@936c29a Updated Upstream (Paper)
PurpurMC/Purpur@032697e Updated Upstream (Paper)
PurpurMC/Purpur@b2d1fea always output bukkit/paper plugin header in plugin command
This commit is contained in:
Dreeam
2024-07-21 08:02:22 +08:00
parent 5f52b3363b
commit 6acb949d2d
21 changed files with 164 additions and 570 deletions

View File

@@ -2,7 +2,7 @@ group = cn.dreeam.leaf
mcVersion = 1.21
version = 1.21-R0.1-SNAPSHOT
galeCommit = d4f0ad7103aeccf39a67153ff4a3df2a6b3693a0
galeCommit = 393246435d796be3eef4424c8c35fd00bd40a826
org.gradle.caching = true
org.gradle.parallel = true

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Purpur API Changes
Original license: MIT
Original project: https://github.com/PurpurMC/Purpur
Commit: 65d3665aee694972cb6c10059c144a0593518b25
Commit: b2d1fea9bea1718e0abf5d7309d0cda7193e981e
Patches below are removed in this patch:
Pufferfish-API-Changes.patch

View File

@@ -1264,10 +1264,10 @@ index df142a89b8c43acb81eb383eac0ef048a1f49a6e..00000000000000000000000000000000
-}
diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java
deleted file mode 100644
index 9812d668ad945aba486fbf6d5bf83c4292cb5d03..0000000000000000000000000000000000000000
index 445b5d3b61f31cf263475d0155a7b0252c54a3f8..0000000000000000000000000000000000000000
--- a/src/main/java/co/aikar/timings/Timings.java
+++ /dev/null
@@ -1,337 +0,0 @@
@@ -1,331 +0,0 @@
-/*
- * This file is licensed under the MIT License (MIT).
- *
@@ -1429,23 +1429,17 @@ index 9812d668ad945aba486fbf6d5bf83c4292cb5d03..00000000000000000000000000000000
-
- public static Component deprecationMessage() {
- return Component.text()
- .color(TextColor.color(0xf3ef91))
- .color(TextColor.color(0xffc93a))
- .append(Component.text("[!] The timings profiler has been enabled but has been scheduled for removal from Paper in the future."))
- .append(Component.newline())
- .append(
- Component.text(" We recommend installing the spark profiler as a replacement: ")
- .append(
- Component.text()
- .content("https://spark.lucko.me/")
- .clickEvent(ClickEvent.openUrl("https://spark.lucko.me/")))
- )
- .append(Component.text(" We recommend migrating to the spark profiler."))
- .append(Component.newline())
- .append(
- Component.text(" For more information please visit: ")
- .append(
- Component.text()
- .content("https://github.com/PaperMC/Paper/issues/8948")
- .clickEvent(ClickEvent.openUrl("https://github.com/PaperMC/Paper/issues/8948")))
- .content("https://github.com/PaperMC/Paper/discussions/10565")
- .clickEvent(ClickEvent.openUrl("https://github.com/PaperMC/Paper/discussions/10565")))
- )
- .build();
- }

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Purpur generated-api Changes
Original license: MIT
Original project: https://github.com/PurpurMC/Purpur
Commit: 65d3665aee694972cb6c10059c144a0593518b25
Commit: b2d1fea9bea1718e0abf5d7309d0cda7193e981e
diff --git a/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/com/destroystokyo/paper/entity/ai/VanillaGoal.java
index 3add91218dd3f07052aa932f0503d1f10ac3799b..3e41a4141095bce989c75e989293deb3f47e8e6d 100644

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Rebrand
diff --git a/build.gradle.kts b/build.gradle.kts
index eae5b87677ac577ceafc6371647e92178627116f..955413bc5717b73054777d36c8b06da8817f8271 100644
index c25f76e726d614d183062c213ab83bd3404b6b15..a79693afc8c21448a4134f730eff910e1b88e2a8 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,7 +13,7 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
@@ -17,7 +17,7 @@ index eae5b87677ac577ceafc6371647e92178627116f..955413bc5717b73054777d36c8b06da8
// Paper start
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0")
@@ -90,14 +90,14 @@ tasks.jar {
@@ -94,14 +94,14 @@ tasks.jar {
val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",

View File

@@ -11,7 +11,7 @@ Add per world config
Add config reload
diff --git a/build.gradle.kts b/build.gradle.kts
index 955413bc5717b73054777d36c8b06da8817f8271..def008852a4fc0ad7c481e73dfaa178d67145f47 100644
index a79693afc8c21448a4134f730eff910e1b88e2a8..ca9f19c451155e3b411171f757ed9feed2a43a58 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -14,6 +14,13 @@ val alsoShade: Configuration by configurations.creating
@@ -41,10 +41,10 @@ index f76ca394169d844a263a53c31c30e57de4381e0d..d2ea951c7e5899d0e2edb52064e35c23
DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(optionset); // CraftBukkit - CLI argument support
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 9fa8d9af5ff8c2f204793ce014375e7b2f220083..7b28d758afbefbd18b7cc914f52339aa400bbb36 100644
index 52a37cd37d5376c329c46c5c6775fc7590d2cf40..e923bbd1d9b5c1783a4486cf4ed8c609b652d8fe 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1217,6 +1217,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1221,6 +1221,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
org.spigotmc.WatchdogThread.tick();
// Paper end - Improved Watchdog Support
org.spigotmc.WatchdogThread.hasStarted = true; // Paper

View File

@@ -20,7 +20,7 @@ and, in my opinion, worth the low risk of minor mob-spawning-related
inconsistencies.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 333beb88e048daaaf44e67984bb17d5201a9ab21..798e6473e33819d6c7a39e25dace3fc241571b0a 100644
index e923bbd1d9b5c1783a4486cf4ed8c609b652d8fe..81c1b8b4154934d91d25527351e8f13f9208af21 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -310,6 +310,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -33,10 +33,10 @@ index 333beb88e048daaaf44e67984bb17d5201a9ab21..798e6473e33819d6c7a39e25dace3fc2
AtomicReference<S> atomicreference = new AtomicReference();
Thread thread = new ca.spottedleaf.moonrise.common.util.TickThread(() -> { // Paper - rewrite chunk system
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 42ac2efb4c84c5f15c10934f928183962f179626..944ada1e0f4e4a8460ec3c8e1d9a0de7469d395b 100644
index 30ddaba93a1b2bb228a9fcdf25e8abab036d9f38..3ca8a80f44ef8c3fbf55250dc1f345e2b1308376 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -373,6 +373,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -375,6 +375,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
DedicatedServer.LOGGER.info("JMX monitoring enabled");
}

View File

@@ -8,7 +8,7 @@ TODO - Dreeam: Check Fix-pufferfish-issues.patch
Original license: MIT
Original project: https://github.com/PurpurMC/Purpur
Commit: 65d3665aee694972cb6c10059c144a0593518b25
Commit: b2d1fea9bea1718e0abf5d7309d0cda7193e981e
Patches below are removed in this patch:
Brand changes in Rebrand.patch
@@ -32,7 +32,7 @@ Remove-Mojang-Profiler.patch
MC-121706-Fix-mobs-not-looking-up-and-down-when-stra.patch
diff --git a/build.gradle.kts b/build.gradle.kts
index def008852a4fc0ad7c481e73dfaa178d67145f47..4370b18d85884a67eec59b45d450973ca34fc408 100644
index ca9f19c451155e3b411171f757ed9feed2a43a58..2053bb1c466dcc34b9057e75062d2dc1d17355a8 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -54,6 +54,12 @@ dependencies {
@@ -48,7 +48,7 @@ index def008852a4fc0ad7c481e73dfaa178d67145f47..4370b18d85884a67eec59b45d450973c
testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
testImplementation("org.hamcrest:hamcrest:2.2")
@@ -161,7 +167,7 @@ fun TaskContainer.registerRunTask(
@@ -165,7 +171,7 @@ fun TaskContainer.registerRunTask(
name: String,
block: JavaExec.() -> Unit
): TaskProvider<JavaExec> = register<JavaExec>(name) {
@@ -176,7 +176,7 @@ index 023016de1732f0b299428ec0544128cc17407333..9d003c2ae45a057c0274a34fe5012cf1
private static final String BUILD_DEV = "DEV";
diff --git a/src/main/java/io/papermc/paper/command/PaperPluginsCommand.java b/src/main/java/io/papermc/paper/command/PaperPluginsCommand.java
index f0fce4113fb07c64adbec029d177c236cbdcbae8..e94224ed280247ee69dfdff8dc960f2b8729be33 100644
index f0fce4113fb07c64adbec029d177c236cbdcbae8..865dc183276720d54d31d2a54d1bb5c845e80598 100644
--- a/src/main/java/io/papermc/paper/command/PaperPluginsCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperPluginsCommand.java
@@ -78,10 +78,10 @@ public class PaperPluginsCommand extends BukkitCommand {
@@ -201,7 +201,7 @@ index f0fce4113fb07c64adbec029d177c236cbdcbae8..e94224ed280247ee69dfdff8dc960f2b
TextComponent.Builder builder = Component.text();
if (provider instanceof SpigotPluginProvider spigotPluginProvider && CraftMagicNumbers.isLegacy(spigotPluginProvider.getMeta())) {
builder.append(LEGACY_PLUGIN_STAR);
@@ -117,12 +117,64 @@ public class PaperPluginsCommand extends BukkitCommand {
@@ -117,13 +117,65 @@ public class PaperPluginsCommand extends BukkitCommand {
String name = provider.getMeta().getName();
Component pluginName = Component.text(name, fromStatus(provider))
@@ -240,13 +240,13 @@ index f0fce4113fb07c64adbec029d177c236cbdcbae8..e94224ed280247ee69dfdff8dc960f2b
+
+ pluginName.hoverEvent(hover.build());
+ }
+ // Purpur end
builder.append(pluginName);
+ // Purpur end
+
+ return builder.build();
+ }
+
return builder.build();
}
+ // Purpur start
+ @NotNull
+ private static TextComponent getAuthors(@NotNull final PluginMeta pluginMeta) {
@@ -260,13 +260,14 @@ index f0fce4113fb07c64adbec029d177c236cbdcbae8..e94224ed280247ee69dfdff8dc960f2b
+
+ builder.append(Component.text(authors.get(i), NamedTextColor.GREEN));
+ }
return builder.build();
}
+
+ return builder.build();
+ }
+ // Purpur end
+
private static Component asPlainComponents(String strings) {
net.kyori.adventure.text.TextComponent.Builder builder = Component.text();
for (String string : strings.split("\n")) {
@@ -182,24 +234,24 @@ public class PaperPluginsCommand extends BukkitCommand {
}
}
@@ -278,20 +279,24 @@ index f0fce4113fb07c64adbec029d177c236cbdcbae8..e94224ed280247ee69dfdff8dc960f2b
- sender.sendMessage(infoMessage);
+ //sender.sendMessage(infoMessage); // Purpur
if (!paperPlugins.isEmpty()) {
- if (!paperPlugins.isEmpty()) {
- sender.sendMessage(PAPER_HEADER);
- }
+ //if (!paperPlugins.isEmpty()) { // Purpur
+ sender.sendMessage(PAPER_HEADER.append(Component.text(" (%s):".formatted(paperPlugins.size())))); // Purpur
}
+ //} // Purpur
- for (Component component : formatProviders(paperPlugins)) {
+ for (Component component : formatProviders(paperPlugins, sender)) { // Purpur
sender.sendMessage(component);
}
if (!spigotPlugins.isEmpty()) {
- if (!spigotPlugins.isEmpty()) {
- sender.sendMessage(BUKKIT_HEADER);
- }
+ //if (!spigotPlugins.isEmpty()) { // Purpur
+ sender.sendMessage(BUKKIT_HEADER.append(Component.text(" (%s):".formatted(spigotPlugins.size())))); // Purpur
}
+ //} // Purpur
- for (Component component : formatProviders(spigotPlugins)) {
+ for (Component component : formatProviders(spigotPlugins, sender)) { // Purpur
@@ -314,139 +319,6 @@ index a8e813ca89b033f061e695288b3383bdcf128531..1ab65af9359d19530bba7f985a604d2a
return;
}
if (SysoutCatcher.NAG_INTERVAL > 0 || SysoutCatcher.NAG_TIMEOUT > 0) {
diff --git a/src/main/java/io/papermc/paper/plugin/PluginInitializerManager.java b/src/main/java/io/papermc/paper/plugin/PluginInitializerManager.java
index 49d8e207795997e5deaf830eb971067f84bfc791..5a896f2fed9adf89840fdf9698389705f147afc6 100644
--- a/src/main/java/io/papermc/paper/plugin/PluginInitializerManager.java
+++ b/src/main/java/io/papermc/paper/plugin/PluginInitializerManager.java
@@ -112,6 +112,7 @@ public class PluginInitializerManager {
@SuppressWarnings("unchecked")
java.util.List<Path> files = ((java.util.List<File>) optionSet.valuesOf("add-plugin")).stream().map(File::toPath).toList();
io.papermc.paper.plugin.util.EntrypointUtil.registerProvidersFromSource(io.papermc.paper.plugin.provider.source.PluginFlagProviderSource.INSTANCE, files);
+ io.papermc.paper.plugin.util.EntrypointUtil.registerProvidersFromSource(io.papermc.paper.plugin.provider.source.SparkProviderSource.INSTANCE, new File("cache", "spark.jar").toPath()); // Purpur
}
// This will be the end of me...
diff --git a/src/main/java/io/papermc/paper/plugin/provider/source/SparkProviderSource.java b/src/main/java/io/papermc/paper/plugin/provider/source/SparkProviderSource.java
new file mode 100644
index 0000000000000000000000000000000000000000..cb78dac8e072b5cb3c6e52e17c9ecdf708aeedc1
--- /dev/null
+++ b/src/main/java/io/papermc/paper/plugin/provider/source/SparkProviderSource.java
@@ -0,0 +1,115 @@
+package io.papermc.paper.plugin.provider.source;
+
+import com.mojang.logging.LogUtils;
+import io.papermc.paper.plugin.entrypoint.Entrypoint;
+import io.papermc.paper.plugin.entrypoint.EntrypointHandler;
+import io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler;
+import io.papermc.paper.plugin.provider.PluginProvider;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.InputStreamReader;
+import java.math.BigInteger;
+import java.net.URL;
+import java.net.URLConnection;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardCopyOption;
+import java.security.MessageDigest;
+import java.util.stream.Collectors;
+import org.bukkit.plugin.java.JavaPlugin;
+import org.slf4j.Logger;
+
+public class SparkProviderSource implements ProviderSource<Path, Path> {
+
+ public static final SparkProviderSource INSTANCE = new SparkProviderSource();
+ private static final FileProviderSource FILE_PROVIDER_SOURCE = new FileProviderSource("File '%s' specified by Purpur"::formatted);
+ private static final Logger LOGGER = LogUtils.getClassLogger();
+
+ @Override
+ public Path prepareContext(Path context) {
+ // first, check if user doesn't want spark at all
+ if (Boolean.getBoolean("Purpur.IReallyDontWantSpark")) {
+ return null; // boo!
+ }
+
+ // second, check if user has their own spark
+ if (hasSpark()) {
+ LOGGER.info("Purpur: Using user-provided spark plugin instead of our own.");
+ return null; // let's hope it's at least the modern version :3
+ }
+
+ // you can't have errors in your code if you wrap the entire codebase in a try/catch block
+ try {
+
+ // make sure the directory exists where we want to keep spark
+ File file = context.toFile();
+ file.getParentFile().mkdirs();
+
+ boolean shouldDownload;
+
+ // check if our spark exists
+ if (!file.exists()) {
+ // it does not, so let's download it
+ shouldDownload = true;
+ } else {
+ // we have a spark file, let's see if it's up-to-date by comparing shas
+ String fileSha1 = String.format("%040x", new BigInteger(1, MessageDigest.getInstance("SHA-1").digest(Files.readAllBytes(file.toPath()))));
+ String sparkSha1;
+
+ // luck has a nifty endpoint containing the sha of the newest version
+ URLConnection urlConnection = new URL("https://sparkapi.lucko.me/download/bukkit/sha1").openConnection();
+
+ // set a reasonable timeout to prevent servers without internet from hanging for 60+ seconds on startup
+ urlConnection.setReadTimeout(5000);
+ urlConnection.setConnectTimeout(5000);
+
+ // read it
+ try (BufferedReader reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()))) {
+ sparkSha1 = reader.lines().collect(Collectors.joining(""));
+ }
+
+ // compare; we only download a new spark if the shas don't match
+ shouldDownload = !fileSha1.equals(sparkSha1);
+ }
+
+ // ok, finally we can download spark if we need it
+ if (shouldDownload) {
+ URLConnection urlConnection = new URL("https://sparkapi.lucko.me/download/bukkit").openConnection();
+ urlConnection.setReadTimeout(5000);
+ urlConnection.setConnectTimeout(5000);
+ Files.copy(urlConnection.getInputStream(), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
+ }
+
+ // register the spark, newly downloaded or existing
+ return FILE_PROVIDER_SOURCE.prepareContext(context);
+
+ } catch (Throwable e) {
+ LOGGER.error("Purpur: Failed to download and install spark plugin", e);
+ }
+ return null;
+ }
+
+ @Override
+ public void registerProviders(final EntrypointHandler entrypointHandler, final Path context) {
+ if (context == null) {
+ return;
+ }
+
+ try {
+ FILE_PROVIDER_SOURCE.registerProviders(entrypointHandler, context);
+ } catch (IllegalArgumentException ignored) {
+ // Ignore illegal argument exceptions from jar checking
+ } catch (Exception e) {
+ LOGGER.error("Error loading our spark plugin: " + e.getMessage(), e);
+ }
+ }
+
+ private static boolean hasSpark() {
+ for (PluginProvider<JavaPlugin> provider : LaunchEntryPointHandler.INSTANCE.get(Entrypoint.PLUGIN).getRegisteredProviders()) {
+ if (provider.getMeta().getName().equalsIgnoreCase("spark")) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
index 2d344df35d47b4b1ecddf32ccaa4dae41e5f58cb..08e783882d0b2ef3ebf88e664f1a3d8bf65f49f2 100644
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
@@ -699,7 +571,7 @@ index d2ea951c7e5899d0e2edb52064e35c23965c4230..b929842514a97ca993ead608d355a4af
Bootstrap.bootStrap();
Bootstrap.validate();
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 6255de543275c78b503d49f4a162e629558c2659..51d67ded0c27825a6958c5622a777aeb214849c4 100644
index 81c1b8b4154934d91d25527351e8f13f9208af21..6b60bdfb517eb56f1cf306bdee394744dd4d58bd 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -289,6 +289,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -719,10 +591,10 @@ index 6255de543275c78b503d49f4a162e629558c2659..51d67ded0c27825a6958c5622a777aeb
public volatile Thread shutdownThread; // Paper
public volatile boolean abnormalExit = false; // Paper
@@ -1021,6 +1024,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftServer.LOGGER.info("Stopping server");
@@ -1024,6 +1027,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
MinecraftTimings.stopServer(); // Paper
this.server.spark.disable(); // Paper - spark
+ // Purpur start
+ if (upnp) {
+ if (dev.omega24.upnp4j.UPnP4J.close(this.getPort(), dev.omega24.upnp4j.util.Protocol.TCP)) {
@@ -734,7 +606,7 @@ index 6255de543275c78b503d49f4a162e629558c2659..51d67ded0c27825a6958c5622a777aeb
// CraftBukkit start
if (this.server != null) {
this.server.disablePlugins();
@@ -1116,6 +1127,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1119,6 +1130,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.safeShutdown(waitForShutdown, false);
}
public void safeShutdown(boolean waitForShutdown, boolean isRestarting) {
@@ -743,7 +615,7 @@ index 6255de543275c78b503d49f4a162e629558c2659..51d67ded0c27825a6958c5622a777aeb
this.isRestarting = isRestarting;
this.hasLoggedStop = true; // Paper - Debugging
if (isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
@@ -1237,6 +1250,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1241,6 +1254,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
// Paper end - Add onboarding message for initial server start
@@ -760,7 +632,7 @@ index 6255de543275c78b503d49f4a162e629558c2659..51d67ded0c27825a6958c5622a777aeb
while (this.running) {
long i;
@@ -1273,6 +1296,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1277,6 +1300,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.recentTps[0] = tps1.getAverage();
this.recentTps[1] = tps5.getAverage();
this.recentTps[2] = tps15.getAverage();
@@ -768,7 +640,7 @@ index 6255de543275c78b503d49f4a162e629558c2659..51d67ded0c27825a6958c5622a777aeb
tickSection = currentTime;
}
// Paper end - further improve server tick loop
@@ -1297,6 +1321,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1301,6 +1325,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end - rewrite chunk system
this.mayHaveDelayedTasks = true;
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + i, this.nextTickTimeNanos);
@@ -781,7 +653,7 @@ index 6255de543275c78b503d49f4a162e629558c2659..51d67ded0c27825a6958c5622a777aeb
this.startMeasuringTaskExecutionTime();
this.waitUntilNextTick();
this.finishMeasuringTaskExecutionTime();
@@ -1738,7 +1768,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1744,7 +1774,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
long worldTime = level.getGameTime();
final ClientboundSetTimePacket worldPacket = new ClientboundSetTimePacket(worldTime, dayTime, doDaylight);
for (Player entityhuman : level.players()) {
@@ -790,7 +662,7 @@ index 6255de543275c78b503d49f4a162e629558c2659..51d67ded0c27825a6958c5622a777aeb
continue;
}
ServerPlayer entityplayer = (ServerPlayer) entityhuman;
@@ -1759,6 +1789,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1765,6 +1795,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
@@ -868,7 +740,7 @@ index 0d9de4c61c7b26a6ff37c12fde629161fd0c3d5a..2f7897744f4aea718170698881773e90
entityitem = entityplayer.drop(itemstack, false, false, false); // CraftBukkit - SPIGOT-2942: Add boolean to call event
if (entityitem != null) {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 230142b2544a5c408f7bf9f85ae57c82c970c452..5d5659a4514402edfd474e176534d363c56e0496 100644
index 3ca8a80f44ef8c3fbf55250dc1f345e2b1308376..fac1809609d2eb2a11a943d5d636903b13d3cc27 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -118,6 +118,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -879,9 +751,9 @@ index 230142b2544a5c408f7bf9f85ae57c82c970c452..5d5659a4514402edfd474e176534d363
new com.destroystokyo.paper.console.PaperConsole(DedicatedServer.this).start();
/*
jline.console.ConsoleReader bufferedreader = DedicatedServer.this.reader;
@@ -245,6 +246,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
@@ -247,6 +248,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
GaleCommands.registerCommands(this); // Gale - Gale commands - register commands
this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
+ // Purpur start
+ try {
@@ -895,7 +767,7 @@ index 230142b2544a5c408f7bf9f85ae57c82c970c452..5d5659a4514402edfd474e176534d363
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
// Gale start - Pufferfish - SIMD support
@@ -300,6 +310,30 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -302,6 +312,30 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
if (true) throw new IllegalStateException("Failed to bind to port", ioexception); // Paper - Propagate failed to bind to port error
return false;
}
@@ -926,7 +798,7 @@ index 230142b2544a5c408f7bf9f85ae57c82c970c452..5d5659a4514402edfd474e176534d363
// CraftBukkit start
// this.setPlayerList(new DedicatedPlayerList(this, this.registries(), this.playerDataStorage)); // Spigot - moved up
@@ -374,6 +408,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -376,6 +410,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
}
if (org.dreeam.leaf.config.modules.async.AsyncMobSpawning.enabled) mobSpawnExecutor.start(); // Pufferfish
@@ -936,7 +808,7 @@ index 230142b2544a5c408f7bf9f85ae57c82c970c452..5d5659a4514402edfd474e176534d363
}
}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index bfe9be2e329c2ea2c8c44458e88d22bc75520ed4..f41853c5195cea0293766a79ae95c59afa281fdb 100644
index d6431376184e5650b370cbab204e28bc31f4dac6..9ebe1f1797b5be562bc4f6d92b9a4d6022ca2151 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -56,6 +56,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
@@ -16975,10 +16847,10 @@ index 9d93130f23addb18b97d7f5ec013faef17a74529..29d2fb87a65778926aea2cfc7a5b486c
+ // Purpur end - OfflinePlayer API
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b653eefc2b3bf1f2eea963b2944b7344ddf5a38c..3786ee6f97fb857649b31139152a77c2ec26494f 100644
index 87023666f2e6dbfa431a50f612fa1b2c16f5e000..c19abc00c723da5da63939a2374c5d71b8e794fc 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -414,6 +414,20 @@ public final class CraftServer implements Server {
@@ -415,6 +415,20 @@ public final class CraftServer implements Server {
this.paperPluginManager = new io.papermc.paper.plugin.manager.PaperPluginManagerImpl(this, this.commandMap, pluginManager);
this.pluginManager.paperPluginManager = this.paperPluginManager;
// Paper end
@@ -16999,7 +16871,7 @@ index b653eefc2b3bf1f2eea963b2944b7344ddf5a38c..3786ee6f97fb857649b31139152a77c2
CraftRegistry.setMinecraftRegistry(console.registryAccess());
@@ -1073,6 +1087,7 @@ public final class CraftServer implements Server {
@@ -1075,6 +1089,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);
this.console.galeConfigurations.reloadConfigs(this.console); // Gale - Gale configuration
@@ -17007,7 +16879,7 @@ index b653eefc2b3bf1f2eea963b2944b7344ddf5a38c..3786ee6f97fb857649b31139152a77c2
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))
@@ -1088,6 +1103,7 @@ public final class CraftServer implements Server {
@@ -1090,6 +1105,7 @@ public final class CraftServer implements Server {
}
}
world.spigotConfig.init(); // Spigot
@@ -17015,15 +16887,15 @@ index b653eefc2b3bf1f2eea963b2944b7344ddf5a38c..3786ee6f97fb857649b31139152a77c2
}
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
@@ -1104,6 +1120,7 @@ public final class CraftServer implements Server {
this.reloadData();
@@ -1107,6 +1123,7 @@ public final class CraftServer implements Server {
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
this.spark.registerCommandBeforePlugins(this); // Paper - spark
+ org.purpurmc.purpur.PurpurConfig.registerCommands(); // Purpur
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
@@ -1613,6 +1630,55 @@ public final class CraftServer implements Server {
@@ -1617,6 +1634,55 @@ public final class CraftServer implements Server {
return true;
}
@@ -17079,7 +16951,7 @@ index b653eefc2b3bf1f2eea963b2944b7344ddf5a38c..3786ee6f97fb857649b31139152a77c2
@Override
public List<Recipe> getRecipesFor(ItemStack result) {
Preconditions.checkArgument(result != null, "ItemStack cannot be null");
@@ -3004,6 +3070,18 @@ public final class CraftServer implements Server {
@@ -3008,6 +3074,18 @@ public final class CraftServer implements Server {
}
// Gale end - Gale configuration - API
@@ -17098,7 +16970,7 @@ index b653eefc2b3bf1f2eea963b2944b7344ddf5a38c..3786ee6f97fb857649b31139152a77c2
@Override
public void restart() {
org.spigotmc.RestartCommand.restart();
@@ -3286,4 +3364,15 @@ public final class CraftServer implements Server {
@@ -3290,4 +3368,15 @@ public final class CraftServer implements Server {
}
// Gale end - YAPFA - last tick time - API
@@ -17168,10 +17040,10 @@ index 1f354c6c09bc49e57a69db7cfa4f2a331dd02bdb..b251b057ec6e0bb90d140be8f4d24a6c
public Collection<GeneratedStructure> getStructures(int x, int z) {
return this.getStructures(x, z, struct -> true);
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index fa01567c64dc929951931807adb88165e49c83bc..68eb9935f09ad38157d50c07c1539d51138e2f3d 100644
index 618f4b2e1d012b647b3e7bf359c8ecdd7f159e63..260f79affee997adbe8d08f2a2cb3aa68083f497 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -197,6 +197,14 @@ public class Main {
@@ -176,6 +176,14 @@ public class Main {
.describedAs("Jar file");
// Paper end
@@ -17186,7 +17058,7 @@ index fa01567c64dc929951931807adb88165e49c83bc..68eb9935f09ad38157d50c07c1539d51
// Paper start
acceptsAll(asList("server-name"), "Name of the server")
.withRequiredArg()
@@ -286,7 +294,7 @@ public class Main {
@@ -265,7 +273,7 @@ public class Main {
System.setProperty(net.minecrell.terminalconsole.TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper
}

View File

@@ -4,30 +4,8 @@ Date: Mon, 29 Apr 2024 14:18:58 -0400
Subject: [PATCH] Fix Pufferfish and Purpur patches
diff --git a/src/main/java/io/papermc/paper/command/PaperPluginsCommand.java b/src/main/java/io/papermc/paper/command/PaperPluginsCommand.java
index e94224ed280247ee69dfdff8dc960f2b8729be33..5b9725a9a81c0850dc2809c150529e5f67a88b66 100644
--- a/src/main/java/io/papermc/paper/command/PaperPluginsCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperPluginsCommand.java
@@ -241,6 +241,8 @@ public class PaperPluginsCommand extends BukkitCommand {
if (!paperPlugins.isEmpty()) {
sender.sendMessage(PAPER_HEADER.append(Component.text(" (%s):".formatted(paperPlugins.size())))); // Purpur
+ } else {
+ sender.sendMessage(PAPER_HEADER.append(Component.text(" (0):"))); // Leaf - Purpur - Makes plugins command better if no plugins
}
for (Component component : formatProviders(paperPlugins, sender)) { // Purpur
@@ -249,6 +251,8 @@ public class PaperPluginsCommand extends BukkitCommand {
if (!spigotPlugins.isEmpty()) {
sender.sendMessage(BUKKIT_HEADER.append(Component.text(" (%s):".formatted(spigotPlugins.size())))); // Purpur
+ } else {
+ sender.sendMessage(BUKKIT_HEADER.append(Component.text(" (0):"))); // Leaf - Purpur - Makes plugins command better if no plugins
}
for (Component component : formatProviders(spigotPlugins, sender)) { // Purpur
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 51d67ded0c27825a6958c5622a777aeb214849c4..4aca88ae4efa4807c2b984dddd0922b36583e379 100644
index 6b60bdfb517eb56f1cf306bdee394744dd4d58bd..3c4e693ed09e7ccc5f94873a2c91e567be72b758 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -300,7 +300,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -48,7 +26,7 @@ index 51d67ded0c27825a6958c5622a777aeb214849c4..4aca88ae4efa4807c2b984dddd0922b3
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
@@ -1032,6 +1032,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1035,6 +1035,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
LOGGER.error("[UPnP] Failed to close port {}", this.getPort());
}
}
@@ -56,7 +34,7 @@ index 51d67ded0c27825a6958c5622a777aeb214849c4..4aca88ae4efa4807c2b984dddd0922b3
// CraftBukkit start
if (this.server != null) {
this.server.disablePlugins();
@@ -1293,9 +1294,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1297,9 +1298,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
tps15.add(currentTps, diff);
// Backwards compat with bad plugins

View File

@@ -7,10 +7,10 @@ Original license: MIT
Original project: https://github.com/PurpurMC/Purpur
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index cff5d0f3193b62f7b7f983c4ac33f98cfedc754c..08c8aae84042619a65c33db9d000e4088319b54e 100644
index 3c4e693ed09e7ccc5f94873a2c91e567be72b758..88edabf6f9b95812da88e3961de7884055429570 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1931,7 +1931,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1937,7 +1937,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate
public String getServerModName() {

View File

@@ -191,10 +191,10 @@ index 6b3cde6d4d1e63bec01f502f2027ee9fddac08aa..00000000000000000000000000000000
-}
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
deleted file mode 100644
index 429cff43a9f0c74161fdab857f5d45771f774ac2..0000000000000000000000000000000000000000
index 29796a404e210f7864f4b33b3367e02531bca2a0..0000000000000000000000000000000000000000
--- a/src/main/java/co/aikar/timings/TimingsExport.java
+++ /dev/null
@@ -1,450 +0,0 @@
@@ -1,391 +0,0 @@
-/*
- * This file is licensed under the MIT License (MIT).
- *
@@ -232,8 +232,6 @@ index 429cff43a9f0c74161fdab857f5d45771f774ac2..00000000000000000000000000000000
-import org.bukkit.configuration.ConfigurationSection;
-import org.bukkit.configuration.MemorySection;
-import org.bukkit.entity.EntityType;
-import org.galemc.gale.configuration.GaleGlobalConfiguration;
-import org.galemc.gale.configuration.timingsexport.VanillaServerPropertiesTimingsExport;
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import oshi.SystemInfo;
@@ -249,8 +247,6 @@ index 429cff43a9f0c74161fdab857f5d45771f774ac2..00000000000000000000000000000000
-import java.net.HttpURLConnection;
-import java.net.InetAddress;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
@@ -335,59 +331,6 @@ index 429cff43a9f0c74161fdab857f5d45771f774ac2..00000000000000000000000000000000
-
- HardwareAbstractionLayer hardwareInfo = new SystemInfo().getHardware();
-
- // Gale start - include hardware specs in timings
- var processor = hardwareInfo.getProcessor();
- var processorIdentifier = processor.getProcessorIdentifier();
- var memory = hardwareInfo.getMemory();
-
- Map<String, Object> hardwareSpecsMap = new LinkedHashMap<>();
- if (GaleGlobalConfiguration.get().misc.includeInTimingsReport.hardwareSpecs.cpu) {
- hardwareSpecsMap.put("cpu", createObject(
- pair("logicalprocessorcount", processor.getLogicalProcessorCount()),
- pair("physicalprocessorcount", processor.getPhysicalProcessorCount()),
- pair("physicalpackagecount", processor.getPhysicalPackageCount()),
- pair("contextswitches", processor.getContextSwitches()),
- pair("interrupts", processor.getInterrupts()),
- pair("maxfreq", processor.getMaxFreq()),
- pair("currentfreq", Arrays.toString(processor.getCurrentFreq())),
- pair("identifier", createObject(
- pair("vendor", String.valueOf(processorIdentifier.getVendor()).trim()),
- pair("name", String.valueOf(processorIdentifier.getName()).trim()),
- pair("family", String.valueOf(processorIdentifier.getFamily()).trim()),
- pair("model", String.valueOf(processorIdentifier.getModel()).trim()),
- pair("vendor", String.valueOf(processorIdentifier.getVendor()).trim()),
- pair("cpu64bit", processorIdentifier.isCpu64bit()),
- pair("vendorfreq", processorIdentifier.getVendorFreq()),
- pair("microarchitecture", String.valueOf(processorIdentifier.getMicroarchitecture()).trim())
- ))
- ));
- }
- if (GaleGlobalConfiguration.get().misc.includeInTimingsReport.hardwareSpecs.disks) {
- hardwareSpecsMap.put("diskstores", toArrayMapper(hardwareInfo.getDiskStores(), disk -> createObject(
- pair("name", String.valueOf(disk.getName()).trim()),
- pair("model", String.valueOf(disk.getModel()).trim()),
- pair("serial", String.valueOf(disk.getSerial()).trim()),
- pair("size", disk.getSize())
- )));
- }
- if (GaleGlobalConfiguration.get().misc.includeInTimingsReport.hardwareSpecs.gpus) {
- hardwareSpecsMap.put("gpus", toArrayMapper(hardwareInfo.getGraphicsCards(), gpu -> createObject(
- pair("name", String.valueOf(gpu.getName()).trim()),
- pair("deviceid", String.valueOf(gpu.getDeviceId()).trim()),
- pair("vendor", String.valueOf(gpu.getVendor()).trim()),
- pair("versioninfo", String.valueOf(gpu.getVersionInfo()).trim()),
- pair("vram", gpu.getVRam())
- )));
- }
- if (GaleGlobalConfiguration.get().misc.includeInTimingsReport.hardwareSpecs.memory) {
- hardwareSpecsMap.put("memory", createObject(
- pair("total", memory.getTotal()),
- pair("available", memory.getAvailable()),
- pair("pagesize", memory.getPageSize())
- ));
- }
- // Gale end - include hardware specs in timings
-
- parent.put("system", createObject(
- pair("timingcost", getCost()),
- pair("loadavg", osInfo.getSystemLoadAverage()),
@@ -405,7 +348,6 @@ index 429cff43a9f0c74161fdab857f5d45771f774ac2..00000000000000000000000000000000
- )),
- pair("cpu", runtime.availableProcessors()),
- pair("cpuname", hardwareInfo.getProcessor().getProcessorIdentifier().getName().trim()),
- pair("hardwarespecs", hardwareSpecsMap), // Gale - include hardware specs in timings
- pair("runtime", runtimeBean.getUptime()),
- pair("flags", StringUtils.join(runtimeBean.getInputArguments(), " ")),
- pair("gc", toObjectMapper(ManagementFactory.getGarbageCollectorMXBeans(), input -> pair(input.getName(), toArray(input.getCollectionCount(), input.getCollectionTime()))))
@@ -493,7 +435,6 @@ index 429cff43a9f0c74161fdab857f5d45771f774ac2..00000000000000000000000000000000
- // Information on the users Config
-
- parent.put("config", createObject(
- pair("server.properties", VanillaServerPropertiesTimingsExport.get()), // Gale - include server.properties in timings
- pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
- pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
- // Gale start - Gale configuration - include in timings
@@ -801,7 +742,7 @@ index 0c3c82b28e581286b798ee58ca4193efc2faff4a..5a2a4f69995f23e799370c05f28f9353
// return true as command was handled
return 1;
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index 65c7a798ae69602f586038ecb2c9ab4f7b968fce..726d5cc3422368e7a2bbdb8fce7484da30e24174 100644
index d20969e18984c9b93483477f31b079686977b1db..ee1ca67597bcc48b11a2ef84a12a2e4190c382be 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -1,6 +1,5 @@
@@ -811,8 +752,8 @@ index 65c7a798ae69602f586038ecb2c9ab4f7b968fce..726d5cc3422368e7a2bbdb8fce7484da
import com.mojang.logging.LogUtils;
import io.papermc.paper.configuration.constraint.Constraints;
import io.papermc.paper.configuration.type.number.IntOr;
@@ -91,37 +90,6 @@ public class GlobalConfiguration extends ConfigurationPart {
public boolean useDisplayNameInQuitMessage = false;
@@ -98,29 +97,6 @@ public class GlobalConfiguration extends ConfigurationPart {
public boolean enableImmediately = false;
}
- @Deprecated(forRemoval = true)
@@ -821,9 +762,8 @@ index 65c7a798ae69602f586038ecb2c9ab4f7b968fce..726d5cc3422368e7a2bbdb8fce7484da
- @Deprecated(forRemoval = true)
- public class Timings extends ConfigurationPart {
- public boolean enabled = false;
- public boolean warnIfEnabled = true; // Gale - recommend disabling timings on startup
- public boolean verbose = true;
- public String url = "https://timin.gs/"; // Gale - use timin.gs by default
- public String url = "https://timings.aikar.co/";
- public boolean serverNamePrivacy = false;
- public List<String> hiddenConfigEntries = List.of(
- "database",
@@ -835,13 +775,6 @@ index 65c7a798ae69602f586038ecb2c9ab4f7b968fce..726d5cc3422368e7a2bbdb8fce7484da
-
- @PostProcess
- private void postProcess() {
- // Gale start - recommend disabling timings on startup
- if (enabled && warnIfEnabled) {
- net.minecraft.server.MinecraftServer.LOGGER.warn("To improve performance, we recommend setting timings.enabled to false in paper-global.yml");
- net.minecraft.server.MinecraftServer.LOGGER.warn("(If you do this, timings will not start on server startup, but you can still start timings later by using /timings on)");
- net.minecraft.server.MinecraftServer.LOGGER.warn("If you would like to disable this message, set timings.warn-if-enabled to false in paper-global.yml.");
- }
- // Gale end - recommend disabling timings on startup
- MinecraftTimings.processConfig(this);
- }
- }
@@ -905,7 +838,7 @@ index e2c24813f59c2fd075c740ac1842a38f20ed8554..1f7f68aad97ee73763c042837f239bdc
} catch (Exception exception) {
if (exception instanceof ReportedException) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 5e591de2fae3b18aa7bd859ccc95f0c9fdee3c4d..c4c8111bd85e6a8acbffea093d209710cb63b2f8 100644
index 88edabf6f9b95812da88e3961de7884055429570..181e966274812a7ceab1246538f5f3af2fcc7c8a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -187,8 +187,6 @@ import org.bukkit.craftbukkit.CraftRegistry;
@@ -917,15 +850,15 @@ index 5e591de2fae3b18aa7bd859ccc95f0c9fdee3c4d..c4c8111bd85e6a8acbffea093d209710
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements ServerInfo, ChunkIOErrorReporter, CommandSource, AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.server.ChunkSystemMinecraftServer { // Paper - rewrite chunk system
public static final int SERVER_THREAD_PRIORITY = Integer.getInteger("gale.thread.priority.server", -1); // Gale - server thread priority environment variable
@@ -1023,7 +1021,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1025,7 +1023,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftServer.LOGGER.info("Stopping server");
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
- MinecraftTimings.stopServer(); // Paper
this.server.spark.disable(); // Paper - spark
// Purpur start
if (upnp) {
if (dev.omega24.upnp4j.UPnP4J.close(this.getPort(), dev.omega24.upnp4j.util.Protocol.TCP)) {
@@ -1484,7 +1481,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1488,7 +1485,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
protected void waitUntilNextTick() {
@@ -933,11 +866,11 @@ index 5e591de2fae3b18aa7bd859ccc95f0c9fdee3c4d..c4c8111bd85e6a8acbffea093d209710
long tickOversleepStart = System.nanoTime(); // Gale - YAPFA - last tick time
this.managedBlock(() -> {
return !this.canSleepForTickNoOversleep(); // Paper - move oversleep into full server tick
@@ -1596,15 +1592,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1600,15 +1596,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void tickServer(BooleanSupplier shouldKeepTicking) {
- co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTimingFullServerTick(); // Paper // Gale - final timings calls
- co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper
long i = Util.getNanos();
// Paper start - move oversleep into full server tick
@@ -949,9 +882,9 @@ index 5e591de2fae3b18aa7bd859ccc95f0c9fdee3c4d..c4c8111bd85e6a8acbffea093d209710
- isOversleep = false;MinecraftTimings.serverOversleep.stopTiming();
+ isOversleep = false;
// Paper end
this.server.spark.tickStart(); // Paper - spark
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events
@@ -1637,11 +1632,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1642,11 +1637,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.isSaving = false;
}
// Paper end - Incremental chunk and player saving
@@ -963,15 +896,15 @@ index 5e591de2fae3b18aa7bd859ccc95f0c9fdee3c4d..c4c8111bd85e6a8acbffea093d209710
// Paper start - Server Tick Events
long endTime = System.nanoTime();
long remaining = (TICK_TIME - (endTime - lastTick)) - catchupTime;
@@ -1661,7 +1652,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1667,7 +1658,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end - Add tick times API and /mspt command
this.logTickMethodTime(i);
org.spigotmc.WatchdogThread.tick(); // Spigot
- co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTimingFullServerTick(); // Paper // Gale - final timings calls
- co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper
}
private void logTickMethodTime(long tickStartTime) {
@@ -1732,9 +1722,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1738,9 +1728,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.getPlayerList().getPlayers().forEach((entityplayer) -> {
entityplayer.connection.suspendFlushing();
});
@@ -981,7 +914,7 @@ index 5e591de2fae3b18aa7bd859ccc95f0c9fdee3c4d..c4c8111bd85e6a8acbffea093d209710
// Paper start - Folia scheduler API
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
getAllLevels().forEach(level -> {
@@ -1750,20 +1738,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1756,20 +1744,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
});
// Paper end - Folia scheduler API
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
@@ -1002,7 +935,7 @@ index 5e591de2fae3b18aa7bd859ccc95f0c9fdee3c4d..c4c8111bd85e6a8acbffea093d209710
// Send time updates to everyone, it will get the right time from the world the player is in.
// Paper start - Perf: Optimize time updates
for (final ServerLevel level : this.getAllLevels()) {
@@ -1783,7 +1766,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1789,7 +1772,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
// Paper end - Perf: Optimize time updates
@@ -1010,7 +943,7 @@ index 5e591de2fae3b18aa7bd859ccc95f0c9fdee3c4d..c4c8111bd85e6a8acbffea093d209710
this.isIteratingOverLevels = true; // Paper - Throw exception on world create while being ticked
Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; move down
@@ -1802,9 +1784,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1808,9 +1790,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit end */
try {
@@ -1020,7 +953,7 @@ index 5e591de2fae3b18aa7bd859ccc95f0c9fdee3c4d..c4c8111bd85e6a8acbffea093d209710
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
@@ -1816,21 +1796,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1822,21 +1802,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
@@ -1043,7 +976,7 @@ index 5e591de2fae3b18aa7bd859ccc95f0c9fdee3c4d..c4c8111bd85e6a8acbffea093d209710
iterator = this.playerList.getPlayers().iterator();
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 5d5659a4514402edfd474e176534d363c56e0496..eef6f0533310a4d1f6e34250e0030e41bec2325a 100644
index fac1809609d2eb2a11a943d5d636903b13d3cc27..0e6d92f450613b1c617ecf723d44d17743f521e2 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -69,7 +69,6 @@ import org.apache.logging.log4j.Level;
@@ -1054,7 +987,7 @@ index 5d5659a4514402edfd474e176534d363c56e0496..eef6f0533310a4d1f6e34250e0030e41
import org.bukkit.craftbukkit.util.TerminalCompletionHandler;
import org.bukkit.craftbukkit.util.TerminalConsoleWriterThread;
import org.bukkit.event.server.ServerCommandEvent;
@@ -561,7 +560,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -563,7 +562,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
}
public void handleConsoleInputs() {
@@ -1062,7 +995,7 @@ index 5d5659a4514402edfd474e176534d363c56e0496..eef6f0533310a4d1f6e34250e0030e41
// Paper start - Perf: use proper queue
ConsoleInput servercommand;
while ((servercommand = this.serverCommandQueue.poll()) != null) {
@@ -577,8 +575,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -579,8 +577,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
this.server.dispatchServerCommand(this.console, servercommand);
// CraftBukkit end
}
@@ -1071,7 +1004,7 @@ index 5d5659a4514402edfd474e176534d363c56e0496..eef6f0533310a4d1f6e34250e0030e41
}
@Override
@@ -850,23 +846,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -852,23 +848,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
if (event.isCancelled()) {
return;
}
@@ -1706,10 +1639,10 @@ index 36540053590c30a902b9986dcf2e74375157822d..fb0ffd302ec87516cd7f28b8b4c6a8e9
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 3786ee6f97fb857649b31139152a77c2ec26494f..5d10f4f9e36c0ef448110788ff54df70256c065c 100644
index c19abc00c723da5da63939a2374c5d71b8e794fc..0eba5c69b36416dab175b73ada52a738700cdc3b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -477,7 +477,6 @@ public final class CraftServer implements Server {
@@ -478,7 +478,6 @@ public final class CraftServer implements Server {
this.saveCommandsConfig();
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
@@ -1717,7 +1650,7 @@ index 3786ee6f97fb857649b31139152a77c2ec26494f..5d10f4f9e36c0ef448110788ff54df70
this.overrideSpawnLimits();
console.autosavePeriod = this.configuration.getInt("ticks-per.autosave");
this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose"));
@@ -1033,10 +1032,8 @@ public final class CraftServer implements Server {
@@ -1035,10 +1034,8 @@ public final class CraftServer implements Server {
commands.performCommand(results, commandLine, commandLine, true);
} catch (CommandException ex) {
this.pluginManager.callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerCommandException(ex, target, sender, args))); // Paper
@@ -1879,52 +1812,6 @@ index 51e30d84080c8d32138217e0e8eda181f7f737db..024dc051986ebb9d83f4bf9b020b586f
}
@Override
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index b4cca06a583fbb7918237de256f43ee61fd8ec6c..dd4a5f610e6e84a73051a8ed46e1961804356ca3 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -80,41 +80,6 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public int premiumAccountSlowLoginTimeout = -1; // Gale - make slow login timeout configurable
public boolean ignoreNullLegacyStructureData = false; // Gale - MultiPaper - ignore null legacy structure data
- public IncludeInTimingsReport includeInTimingsReport;
-
- public class IncludeInTimingsReport extends ConfigurationPart {
-
- // Gale start - include server.properties in timings
- public ServerProperties serverProperties;
- public class ServerProperties extends ConfigurationPart {
- public boolean dataPacks = true;
- public boolean enableRcon = false;
- public boolean generatorSettings = true;
- public boolean levelName = false;
- public boolean motd = false;
- public boolean queryPort = false;
- public boolean rconPort = false;
- public boolean resourcePackPrompt = false;
- @Setting("resource-pack-and-resource-pack-sha1")
- public boolean resourcePackAndResourcePackSha1 = false;
- public boolean serverIp = false;
- public boolean serverPort = false;
- public boolean textFilteringConfig = false;
- }
- // Gale end - include server.properties in timings
-
- // Gale start - include hardware specs in timings
- public HardwareSpecs hardwareSpecs;
- public class HardwareSpecs extends ConfigurationPart {
- public boolean cpu = true;
- public boolean disks = true;
- public boolean gpus = true;
- public boolean memory = true;
- }
- // Gale end - include hardware specs in timings
-
- }
-
public Keepalive keepalive;
public class Keepalive extends ConfigurationPart {
public boolean sendMultiple = true; // Gale - Purpur - send multiple keep-alive packets
diff --git a/src/main/java/org/galemc/gale/configuration/timingsexport/GaleConfigurationTimingsExport.java b/src/main/java/org/galemc/gale/configuration/timingsexport/GaleConfigurationTimingsExport.java
deleted file mode 100644
index 579c2e69d8f6ce8398eb1297d1d1ead98c9068a5..0000000000000000000000000000000000000000
@@ -1950,141 +1837,6 @@ index 579c2e69d8f6ce8398eb1297d1d1ead98c9068a5..00000000000000000000000000000000
- }
-
-}
diff --git a/src/main/java/org/galemc/gale/configuration/timingsexport/VanillaServerPropertiesTimingsExport.java b/src/main/java/org/galemc/gale/configuration/timingsexport/VanillaServerPropertiesTimingsExport.java
deleted file mode 100644
index 139d946346594d2a59a8b2930c4eae794c880dbc..0000000000000000000000000000000000000000
--- a/src/main/java/org/galemc/gale/configuration/timingsexport/VanillaServerPropertiesTimingsExport.java
+++ /dev/null
@@ -1,129 +0,0 @@
-// Gale - include server.properties in timings
-
-package org.galemc.gale.configuration.timingsexport;
-
-import co.aikar.timings.TimingsExport;
-import net.minecraft.server.MinecraftServer;
-import net.minecraft.server.dedicated.DedicatedServer;
-import org.galemc.gale.configuration.GaleGlobalConfiguration;
-import org.jetbrains.annotations.NotNull;
-import org.json.simple.JSONObject;
-
-import java.util.Optional;
-
-/**
- * Exports the vanilla server.properties to a JSON object, to be included in a timings report.
- *
- * @see TimingsExport
- *
- * @author Martijn Muijsers under GPL-3.0
- */
-public final class VanillaServerPropertiesTimingsExport {
-
- private VanillaServerPropertiesTimingsExport() {}
-
- @SuppressWarnings("unchecked")
- public static @NotNull JSONObject get() {
-
- var json = new JSONObject();
- var properties = ((DedicatedServer) MinecraftServer.getServer()).getProperties();
- var includeConfig = GaleGlobalConfiguration.get().misc.includeInTimingsReport.serverProperties;
-
- json.put("allow-flight", String.valueOf(properties.allowFlight));
- json.put("allow-nether", String.valueOf(properties.allowNether));
- json.put("broadcast-console-to-ops", String.valueOf(properties.broadcastConsoleToOps));
- json.put("broadcast-rcon-to-ops", String.valueOf(properties.broadcastRconToOps));
- json.put("debug", String.valueOf(properties.debug));
- json.put("difficulty", String.valueOf(properties.difficulty));
- json.put("enable-command-block", String.valueOf(properties.enableCommandBlock));
- json.put("enable-jmx-monitoring", String.valueOf(properties.enableJmxMonitoring));
- json.put("enable-query", String.valueOf(properties.enableQuery));
- if (includeConfig.enableRcon) {
- json.put("enable-rcon", String.valueOf(properties.enableRcon));
- }
- json.put("enable-status", String.valueOf(properties.enableStatus));
- json.put("enforce-secure-profile", String.valueOf(properties.enforceSecureProfile));
- json.put("enforce-whitelist", String.valueOf(properties.enforceWhitelist));
- json.put("entity-broadcast-range-percentage", String.valueOf(properties.entityBroadcastRangePercentage));
- json.put("force-gamemode", String.valueOf(properties.forceGameMode));
- json.put("function-permission-level", String.valueOf(properties.functionPermissionLevel));
- json.put("gamemode", String.valueOf(properties.gamemode));
- Optional.ofNullable(properties.worldOptions).ifPresent(worldOptions -> json.put("generate-structures", String.valueOf(worldOptions.generateStructures())));
- if (includeConfig.generatorSettings) {
- Optional.ofNullable(properties.worldDimensionData).ifPresent(worldDimensionData -> json.put("generator-settings", String.valueOf(worldDimensionData.generatorSettings())));
- }
- json.put("hardcore", String.valueOf(properties.hardcore));
- json.put("hide-online-players", String.valueOf(properties.hideOnlinePlayers));
- if (includeConfig.dataPacks) {
- Optional.ofNullable(properties.initialDataPackConfiguration).ifPresent(initialDataPackConfiguration -> {
- json.put("initial-enabled-packs", String.valueOf(initialDataPackConfiguration.getEnabled()));
- json.put("initial-disabled-packs", String.valueOf(initialDataPackConfiguration.getDisabled()));
- });
- }
- if (includeConfig.levelName) {
- json.put("level-name", String.valueOf(properties.levelName));
- }
- // Note: level-seed is never included to prevent it being leaked
-// if (includeConfig.levelSeed) {
-// json.put("level-seed", String.valueOf(properties.levelSeed));
-// }
- Optional.ofNullable(properties.worldDimensionData).ifPresent(worldDimensionData -> json.put("level-type", String.valueOf(worldDimensionData.levelType())));
- json.put("log-ips", String.valueOf(properties.logIPs));
- json.put("max-chained-neighbor-updates", String.valueOf(properties.maxChainedNeighborUpdates));
- json.put("max-players", String.valueOf(properties.maxPlayers));
- json.put("max-tick-time", String.valueOf(properties.maxTickTime));
- json.put("max-world-size", String.valueOf(properties.maxWorldSize));
- if (includeConfig.motd) {
- json.put("motd", String.valueOf(properties.motd));
- }
- json.put("network-compression-threshold", String.valueOf(properties.networkCompressionThreshold));
- json.put("online-mode", String.valueOf(properties.onlineMode));
- json.put("op-permission-level", String.valueOf(properties.opPermissionLevel));
- Optional.ofNullable(properties.playerIdleTimeout).ifPresent(playerIdleTimeout -> json.put("player-idle-timeout", String.valueOf(playerIdleTimeout.get())));
- json.put("prevent-proxy-connections", String.valueOf(properties.preventProxyConnections));
- json.put("pvp", String.valueOf(properties.pvp));
- if (includeConfig.queryPort) {
- json.put("query-port", String.valueOf(properties.queryPort));
- }
- json.put("rate-limit", String.valueOf(properties.rateLimitPacketsPerSecond));
- // Note: rcon-password is never included to prevent it being leaked
-// if (includeConfig.rconPassword) {
-// json.put("rcon-password", String.valueOf(properties.rconPassword));
-// }
- if (includeConfig.rconPort) {
- json.put("rcon-port", String.valueOf(properties.queryPort));
- }
- properties.serverResourcePackInfo.ifPresent(serverResourcePackInfo -> {
- json.put("require-resource-pack", String.valueOf(serverResourcePackInfo.isRequired()));
- if (includeConfig.resourcePackAndResourcePackSha1) {
- json.put("resource-pack", String.valueOf(serverResourcePackInfo.url()));
- json.put("resource-pack-sha1", String.valueOf(serverResourcePackInfo.hash()));
- }
- });
- if (includeConfig.resourcePackPrompt) {
- json.put("resource-pack-prompt", String.valueOf(properties.resourcePackPrompt));
- }
- if (includeConfig.serverIp) {
- json.put("server-ip", String.valueOf(properties.serverIp));
- }
- if (includeConfig.serverPort) {
- json.put("server-port", String.valueOf(properties.serverPort));
- }
- json.put("simulation-distance", String.valueOf(properties.simulationDistance));
- json.put("spawn-animals", String.valueOf(properties.spawnAnimals));
- json.put("spawn-monsters", String.valueOf(properties.spawnMonsters));
- json.put("spawn-npcs", String.valueOf(properties.spawnNpcs));
- json.put("spawn-protection", String.valueOf(properties.spawnProtection));
- json.put("sync-chunk-writes", String.valueOf(properties.syncChunkWrites));
- if (includeConfig.textFilteringConfig) {
- json.put("text-filtering-config", String.valueOf(properties.textFilteringConfig));
- }
- json.put("use-native-transport", String.valueOf(properties.useNativeTransport));
- json.put("view-distance", String.valueOf(properties.viewDistance));
- Optional.ofNullable(properties.whiteList).ifPresent(whiteList -> json.put("white-list", String.valueOf(whiteList.get())));
-
- return json;
-
- }
-
-}
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 530c5d656b6b362d0df85a897d7e8d0497250680..7fd2a463e9208635bd2d9f0b1a4291d60c5dedf2 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Bump Dependencies
diff --git a/build.gradle.kts b/build.gradle.kts
index 4370b18d85884a67eec59b45d450973ca34fc408..2dde13d18112b3f5a356546a59aca06bf6771a58 100644
index 2053bb1c466dcc34b9057e75062d2dc1d17355a8..f8345586b3e72cb222adf5ae8986f3e92a670eac 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -22,7 +22,7 @@ dependencies {
@@ -73,16 +73,16 @@ index 4370b18d85884a67eec59b45d450973ca34fc408..2dde13d18112b3f5a356546a59aca06b
testImplementation("org.ow2.asm:asm-tree:9.7")
testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest
implementation("net.neoforged:srgutils:1.0.9") // Paper - mappings handling
@@ -74,6 +78,8 @@ dependencies {
implementation("io.papermc:reflection-rewriter-runtime:$reflectionRewriterVersion")
implementation("io.papermc:reflection-rewriter-proxy-generator:$reflectionRewriterVersion")
// Paper end - Remap reflection
@@ -78,6 +82,8 @@ dependencies {
implementation("me.lucko:spark-api:0.1-20240720.200737-2")
implementation("me.lucko:spark-paper:1.10.84-20240720.204128-1")
// Paper end - spark
+
+ implementation("io.netty:netty-all:4.1.111.Final") // Leaf - Bump Dependencies
}
paperweight {
@@ -267,3 +273,8 @@ sourceSets {
@@ -271,3 +277,8 @@ sourceSets {
}
}
// Gale end - package license into jar

View File

@@ -51,10 +51,10 @@ index 1967c43ee3a12e63365cc40ee6565307e2fd73cf..6e376d0db5321d8e9b6e0b54617ffd17
assert isValidPath(path);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c4c8111bd85e6a8acbffea093d209710cb63b2f8..c5fa13527dc1729f7cbb15067b4edf449c2f6fb1 100644
index 181e966274812a7ceab1246538f5f3af2fcc7c8a..0efdd09dea7e43264fe764b92f1de250df421866 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1802,6 +1802,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1808,6 +1808,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
GameTestTicker.SINGLETON.tick();
}
@@ -109,18 +109,18 @@ index b309541c4a29015ad51e05bb341462bcf247f1eb..3f127b7ca317c14ffeb1d8c3440848ad
org.purpurmc.purpur.task.BossBarTask.removeFromAll(entityplayer.getBukkitEntity()); // Purpur
ServerLevel worldserver = entityplayer.serverLevel();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 5d10f4f9e36c0ef448110788ff54df70256c065c..9f0dc22197fbed1baa11fe372566be7e0f875d63 100644
index 0eba5c69b36416dab175b73ada52a738700cdc3b..d8559e5b4bb1e3781a394277f5c242a2ea7ca16c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -491,6 +491,7 @@ public final class CraftServer implements Server {
}
@@ -493,6 +493,7 @@ public final class CraftServer implements Server {
this.potionBrewer = new io.papermc.paper.potion.PaperPotionBrewer(console); // Paper - custom potion mixes
datapackManager = new io.papermc.paper.datapack.PaperDatapackManager(console.getPackRepository()); // Paper
this.spark = new io.papermc.paper.SparksFly(this); // Paper - spark
+ org.leavesmc.leaves.protocol.core.LeavesProtocolManager.init(); // Leaves - protocol
}
public boolean getCommandBlockOverride(String command) {
@@ -1120,6 +1121,7 @@ public final class CraftServer implements Server {
@@ -1123,6 +1124,7 @@ public final class CraftServer implements Server {
org.purpurmc.purpur.PurpurConfig.registerCommands(); // Purpur
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");

View File

@@ -12,7 +12,7 @@ This format saves about 50% of disk space.
Documentation: https://github.com/xymb-endcrystalme/LinearRegionFileFormatTools
diff --git a/build.gradle.kts b/build.gradle.kts
index 2dde13d18112b3f5a356546a59aca06bf6771a58..8ca21359f9be43d59417448554a9aaebd5140094 100644
index f8345586b3e72cb222adf5ae8986f3e92a670eac..9f8d3e2b4a5e479c51a2381cfcaffc6fd9de0a50 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -21,6 +21,11 @@ dependencies {
@@ -71,10 +71,10 @@ index 3218cbf84f54daf06e84442d5eb1a36d8da6b215..ec9b27177dc526510e86d85f48f167b4
synchronized (cache) {
regionFile = ((ChunkSystemRegionFileStorage)(Object)cache).moonrise$getRegionFileIfLoaded(chunkX, chunkZ);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c5fa13527dc1729f7cbb15067b4edf449c2f6fb1..b39f743e008a26b8d5ca88b6175b50ffcb8e3c99 100644
index 0efdd09dea7e43264fe764b92f1de250df421866..8a628ba3edda27a2d39e6212463f80746c71ffc8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -966,10 +966,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -968,10 +968,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator1.hasNext()) {
ServerLevel worldserver2 = (ServerLevel) iterator1.next();

View File

@@ -75,7 +75,7 @@ index c03608fec96b51e1867f43d8f42e5aefb1520e46..15b21fa3907db1b77ed5b5d1050a37f4
throw new IllegalStateException("Ticking retired scheduler");
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b39f743e008a26b8d5ca88b6175b50ffcb8e3c99..8d68a765621d37bd3e1f140a17e3f53bf294cfe7 100644
index 8a628ba3edda27a2d39e6212463f80746c71ffc8..75a927ac8c56a2e48ae26ae36916326d17793293 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -312,6 +312,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -86,7 +86,7 @@ index b39f743e008a26b8d5ca88b6175b50ffcb8e3c99..8d68a765621d37bd3e1f140a17e3f53b
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
@@ -1725,6 +1726,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1731,6 +1732,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit
// Paper start - Folia scheduler API
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
@@ -105,7 +105,7 @@ index b39f743e008a26b8d5ca88b6175b50ffcb8e3c99..8d68a765621d37bd3e1f140a17e3f53b
getAllLevels().forEach(level -> {
for (final Entity entity : level.moonrise$getEntityLookup().getAllCopy()) { // Paper - rewrite chunk system
if (entity.isRemoved()) {
@@ -1736,6 +1749,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1742,6 +1755,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
});

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Including 5s in getTPS()
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 9f0dc22197fbed1baa11fe372566be7e0f875d63..17ad1c108dc4567c750890b39edd25ee350dc4a3 100644
index d8559e5b4bb1e3781a394277f5c242a2ea7ca16c..85e78570ca4ac27e7bcb4ce876b8d90eb586a75b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -3109,6 +3109,8 @@ public final class CraftServer implements Server {
@@ -3113,6 +3113,8 @@ public final class CraftServer implements Server {
@Override
public double[] getTPS() {

View File

@@ -71,10 +71,10 @@ index 50dc68a005490415b88780397ef6c26859596dd5..162115048cffc824376e54b7f60ae071
public static record Favicon(byte[] iconBytes) {
private static final String PREFIX = "data:image/png;base64,";
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index eef6f0533310a4d1f6e34250e0030e41bec2325a..5cafa643d2338b8904ad320c520205e9dc3e29cc 100644
index 0e6d92f450613b1c617ecf723d44d17743f521e2..af820999e45aba5f62b9a89bf3753ea0556647f8 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -709,6 +709,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -711,6 +711,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@Override
public boolean enforceSecureProfile() {

View File

@@ -11,10 +11,10 @@ Original license: GPLv3
Original project: https://github.com/plasmoapp/matter
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index f41853c5195cea0293766a79ae95c59afa281fdb..b9309888451336da2b9bb9147358df91b92eff3d 100644
index 9ebe1f1797b5be562bc4f6d92b9a4d6022ca2151..dcfcf20ded591cf450b38b9e5ae30ed372afb8db 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -168,7 +168,17 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
@@ -165,7 +165,17 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
boolean flag = this.get("generate-structures", true);
long i = WorldOptions.parseSeed(s).orElse(WorldOptions.randomSeed());
@@ -450,10 +450,10 @@ index 45e262308aebafa377a2353661acdd122933b99e..96b9e91997bba777ebe868ca5ab5e5e9
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 17ad1c108dc4567c750890b39edd25ee350dc4a3..85e7442e2ff74fd7884e4e6e74c5637be729b9b8 100644
index 85e78570ca4ac27e7bcb4ce876b8d90eb586a75b..203b8a1c06aa9bfa0a54fcbf1c90dea0134af16e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1396,7 +1396,11 @@ public final class CraftServer implements Server {
@@ -1400,7 +1400,11 @@ public final class CraftServer implements Server {
iregistrycustom_dimension = leveldataanddimensions.dimensions().dimensionsRegistryAccess();
} else {
LevelSettings worldsettings;

View File

@@ -4,17 +4,16 @@ Date: Thu, 2 May 2024 20:21:29 -0400
Subject: [PATCH] Ignore terminal provider warning
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 68eb9935f09ad38157d50c07c1539d51138e2f3d..b5bf415a61bcc3b605ec776be99b4e184c0f4210 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -324,6 +324,9 @@ public class Main {
// Paper end - Log Java and OS versioning to help with debugging plugin issues
diff --git a/src/main/java/io/papermc/paper/PaperBootstrap.java b/src/main/java/io/papermc/paper/PaperBootstrap.java
index d543b1b107ab8d3eeb1fc3c1cadf489928d2786e..2a554d152403d30b167c0bece8c9e1a2c8ff0bdf 100644
--- a/src/main/java/io/papermc/paper/PaperBootstrap.java
+++ b/src/main/java/io/papermc/paper/PaperBootstrap.java
@@ -18,6 +18,8 @@ public final class PaperBootstrap {
printlnStartupInfoToSystemOut("Loading libraries, please wait..."); // Gale - include time in startup logs
getStartupVersionMessages().forEach(LOGGER::info);
+ System.setProperty("org.jline.terminal.disableDeprecatedProviderWarning", "true"); // Leaf - Ignore terminal provider warning
+
+ System.setProperty("org.jline.terminal.disableDeprecatedProviderWarning", "true"); // Leaf - Ignore terminal provider warning
+
net.minecraft.server.Main.main(options);
} catch (Throwable t) {
t.printStackTrace();
Main.main(options);
}

View File

@@ -6,15 +6,15 @@ Subject: [PATCH] Fix console freeze above JAVA 22
Revert to old console provider, Fix https://github.com/PaperMC/Paper/issues/10405
Solution refers to https://inside.java/2023/07/31/quality-heads-up
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index b5bf415a61bcc3b605ec776be99b4e184c0f4210..0b8e68ad835e404e971ef5d15790053c89c88149 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -326,6 +326,7 @@ public class Main {
printlnStartupInfoToSystemOut("Loading libraries, please wait..."); // Gale - include time in startup logs
diff --git a/src/main/java/io/papermc/paper/PaperBootstrap.java b/src/main/java/io/papermc/paper/PaperBootstrap.java
index 2a554d152403d30b167c0bece8c9e1a2c8ff0bdf..fb19a2f9e219656aa89f6d82edc64bc0d68c1ff1 100644
--- a/src/main/java/io/papermc/paper/PaperBootstrap.java
+++ b/src/main/java/io/papermc/paper/PaperBootstrap.java
@@ -19,6 +19,7 @@ public final class PaperBootstrap {
getStartupVersionMessages().forEach(LOGGER::info);
System.setProperty("org.jline.terminal.disableDeprecatedProviderWarning", "true"); // Leaf - Ignore terminal provider warning
+ if (org.galemc.gale.virtualthread.VirtualThreadService.getJavaMajorVersion() >= 22) System.setProperty("jdk.console", "java.base"); // Leaf - Fix console freeze above JAVA 22
System.setProperty("org.jline.terminal.disableDeprecatedProviderWarning", "true"); // Leaf - Ignore terminal provider warning
+ if (org.galemc.gale.virtualthread.VirtualThreadService.getJavaMajorVersion() >= 22) System.setProperty("jdk.console", "java.base"); // Leaf - Fix console freeze above JAVA 22
net.minecraft.server.Main.main(options);
} catch (Throwable t) {
Main.main(options);
}

View File

@@ -5,22 +5,21 @@ Subject: [PATCH] Fix console output display on Pterodactyl panel
Fixed console display issue when the terminal used xterm, should work on Pterodactyl, MCSManager and kind of panel software
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 0b8e68ad835e404e971ef5d15790053c89c88149..559dbad09d8e1ef45de31617167c546493a93630 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -328,6 +328,14 @@ public class Main {
System.setProperty("org.jline.terminal.disableDeprecatedProviderWarning", "true"); // Leaf - Ignore terminal provider warning
if (org.galemc.gale.virtualthread.VirtualThreadService.getJavaMajorVersion() >= 22) System.setProperty("jdk.console", "java.base"); // Leaf - Fix console freeze above JAVA 22
diff --git a/src/main/java/io/papermc/paper/PaperBootstrap.java b/src/main/java/io/papermc/paper/PaperBootstrap.java
index fb19a2f9e219656aa89f6d82edc64bc0d68c1ff1..b4b3264ea7b3f6eb2d693af28a492620026287a8 100644
--- a/src/main/java/io/papermc/paper/PaperBootstrap.java
+++ b/src/main/java/io/papermc/paper/PaperBootstrap.java
@@ -20,6 +20,13 @@ public final class PaperBootstrap {
+ // Leaf start - Fix console output display on Pterodactyl panel
+ if (System.getProperty("terminal.jline", "false") != null && System.getProperty("terminal.ansi", "true") != null
+ && "xterm".equalsIgnoreCase(System.getenv("TERM"))) {
+ System.setProperty("terminal.jline", "false");
+ System.setProperty("terminal.ansi", "true");
+ }
+ // Leaf end - Fix console output display on Pterodactyl panel
+
net.minecraft.server.Main.main(options);
} catch (Throwable t) {
t.printStackTrace();
System.setProperty("org.jline.terminal.disableDeprecatedProviderWarning", "true"); // Leaf - Ignore terminal provider warning
if (org.galemc.gale.virtualthread.VirtualThreadService.getJavaMajorVersion() >= 22) System.setProperty("jdk.console", "java.base"); // Leaf - Fix console freeze above JAVA 22
+ // Leaf start - Fix console output display on Pterodactyl panel
+ if (System.getProperty("terminal.jline", "false") != null && System.getProperty("terminal.ansi", "true") != null
+ && "xterm".equalsIgnoreCase(System.getenv("TERM"))) {
+ System.setProperty("terminal.jline", "false");
+ System.setProperty("terminal.ansi", "true");
+ }
+ // Leaf end - Fix console output display on Pterodactyl panel
Main.main(options);
}