diff --git a/build.gradle.kts b/build.gradle.kts index bae525f..dd2324a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,7 +18,7 @@ repositories { } dependencies { - remapper("net.fabricmc:tiny-remapper:0.10.1:fat") + remapper("net.fabricmc:tiny-remapper:0.10.2:fat") decompiler("org.vineflower:vineflower:1.10.1") paperclip("io.papermc:paperclip:3.0.3") } @@ -54,8 +54,8 @@ subprojects { repositories { mavenCentral() + maven(paperMavenPublicUrl) maven("https://oss.sonatype.org/content/groups/public/") - maven("https://papermc.io/repo/repository/maven-public/") maven("https://ci.emc.gs/nexus/content/groups/aikar/") maven("https://repo.aikar.co/content/groups/aikar") maven("https://repo.md-5.net/content/repositories/releases/") diff --git a/gradle.properties b/gradle.properties index c4f2847..27d0dc1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ group = space.bxteam.divinemc version = 1.20.6-R0.1-SNAPSHOT -purpurRef = ba950ad7758d4da6ccc26f578521ab4a07a2402d +purpurRef = 9dcfdf13c206866ec56b4044f4a7905886a669ea org.gradle.caching = true org.gradle.parallel = true diff --git a/patches/api/0001-Divine-Branding.patch b/patches/api/0001-Divine-Branding.patch new file mode 100644 index 0000000..a579da3 --- /dev/null +++ b/patches/api/0001-Divine-Branding.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com> +Date: Sat, 18 May 2024 01:10:38 +0300 +Subject: [PATCH] Divine Branding + + +diff --git a/src/main/java/io/papermc/paper/ServerBuildInfo.java b/src/main/java/io/papermc/paper/ServerBuildInfo.java +index 7107eabf02d9d9b69d97c978ba421ad52031ec3f..f6005cb48750fdcf903609f3fb693895df229bc2 100644 +--- a/src/main/java/io/papermc/paper/ServerBuildInfo.java ++++ b/src/main/java/io/papermc/paper/ServerBuildInfo.java +@@ -25,6 +25,13 @@ public interface ServerBuildInfo { + Key BRAND_PURPUR_ID = Key.key("purpurmc", "purpur"); + // Purpur end + ++ // DivineMC start ++ /** ++ * The brand id for DivineMC. ++ */ ++ Key BRAND_DIVINEMC_ID = Key.key("divinemc", "divinemc"); ++ // DivineMC end ++ + /** + * Gets the {@code ServerBuildInfo}. + * diff --git a/patches/api/0001-Divine-Configuration.patch b/patches/api/0002-Divine-Configuration.patch similarity index 89% rename from patches/api/0001-Divine-Configuration.patch rename to patches/api/0002-Divine-Configuration.patch index 4a10da9..ea2cd69 100644 --- a/patches/api/0001-Divine-Configuration.patch +++ b/patches/api/0002-Divine-Configuration.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Divine Configuration diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 320422ff95773efa01e8205edcc5c6c9a84d5ecd..ec743558a4901513c1e2266c1058f65dcfc29d1a 100644 +index ec8b9b2cbe65838a194281f7d76d0e17defc5211..adeb76886e99bd8f8374102471c71694ab5a30e4 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -2269,6 +2269,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi diff --git a/patches/api/0002-Disable-reload-command-by-default.patch b/patches/api/0003-Disable-reload-command-by-default.patch similarity index 100% rename from patches/api/0002-Disable-reload-command-by-default.patch rename to patches/api/0003-Disable-reload-command-by-default.patch diff --git a/patches/api/0003-Optimize-Paper-Event-Manager.patch b/patches/api/0004-Optimize-Paper-Event-Manager.patch similarity index 100% rename from patches/api/0003-Optimize-Paper-Event-Manager.patch rename to patches/api/0004-Optimize-Paper-Event-Manager.patch diff --git a/patches/api/0004-Delete-Timings.patch b/patches/api/0005-Delete-Timings.patch similarity index 100% rename from patches/api/0004-Delete-Timings.patch rename to patches/api/0005-Delete-Timings.patch diff --git a/patches/api/0005-DivineMC-API-Publish.patch b/patches/api/0006-DivineMC-API-Publish.patch similarity index 100% rename from patches/api/0005-DivineMC-API-Publish.patch rename to patches/api/0006-DivineMC-API-Publish.patch diff --git a/patches/server/0001-Divine-Branding.patch b/patches/server/0001-Divine-Branding.patch index e682741..cc2b1ea 100644 --- a/patches/server/0001-Divine-Branding.patch +++ b/patches/server/0001-Divine-Branding.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Divine Branding diff --git a/build.gradle.kts b/build.gradle.kts -index 89f21e21efc5f5ab99d1586f4f3b8f2f3c48ac06..682908b659fd11b781fc1ce0aebc3cbd58cb061a 100644 +index d23ecfabf6bf1e355fb2efe5abd80236259ce3c4..ba4a171468365dbfa95d50f4eb2830815eb167e3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -12,7 +12,7 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) { +@@ -13,7 +13,7 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) { val alsoShade: Configuration by configurations.creating dependencies { @@ -17,15 +17,26 @@ index 89f21e21efc5f5ab99d1586f4f3b8f2f3c48ac06..682908b659fd11b781fc1ce0aebc3cbd // Paper start implementation("org.jline:jline-terminal-jansi:3.21.0") implementation("net.minecrell:terminalconsoleappender:1.3.0") -@@ -82,7 +82,7 @@ tasks.jar { +@@ -84,14 +84,14 @@ tasks.jar { + val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", - "Implementation-Title" to "CraftBukkit", -- "Implementation-Version" to "git-Purpur-$implementationVersion", // Pufferfish // Purpur -+ "Implementation-Version" to "git-DivineMC-$implementationVersion", // Pufferfish // Purpur // DivineMC +- "Implementation-Title" to "Purpur", // Purpur ++ "Implementation-Title" to "DivineMC", // DivineMC + "Implementation-Version" to implementationVersion, "Implementation-Vendor" to date, // Paper - "Specification-Title" to "Bukkit", +- "Specification-Title" to "Purpur", // Purpur ++ "Specification-Title" to "DivineMC", // DivineMC "Specification-Version" to project.version, +- "Specification-Vendor" to "Purpur Team", // Purpur +- "Brand-Id" to "purpurmc:purpur", // Purpur +- "Brand-Name" to "Purpur", // Purpur ++ "Specification-Vendor" to "BX Team", // DivineMC + BX Team ++ "Brand-Id" to "divinemc:divinemc", // DivineMC ++ "Brand-Name" to "DivineMC", // DivineMC + "Build-Number" to (build ?: ""), + "Build-Time" to Instant.now().toString(), + "Git-Branch" to gitBranch, // Paper diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..8b06174a9c42ea1d5a1cc5a423a0d6f7304a06c4 100644 --- a/src/main/java/com/destroystokyo/paper/Metrics.java @@ -56,18 +67,17 @@ index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..8b06174a9c42ea1d5a1cc5a423a0d6f7 metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> { Map> map = new HashMap<>(); diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..fb3d33117279df26ddd55005d16f80b6ce273ac3 100644 +index 6d36fc6d8e22d9b68dea3830f6ecc8763184c343..4d2a8974546016b80182ca30e34a1d85055caa87 100644 --- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -@@ -20,21 +20,21 @@ import java.util.stream.StreamSupport; - public class PaperVersionFetcher implements VersionFetcher { - private static final java.util.regex.Pattern VER_PATTERN = java.util.regex.Pattern.compile("^([0-9\\.]*)\\-.*R"); // R is an anchor, will always give '-R' at end +@@ -36,13 +36,13 @@ public class PaperVersionFetcher implements VersionFetcher { + private static final int DISTANCE_ERROR = -1; + private static final int DISTANCE_UNKNOWN = -2; // Purpur start - private static final String DOWNLOAD_PAGE = "https://purpurmc.org/downloads"; + private static final String DOWNLOAD_PAGE = "https://github.com/DivineMC/DivineMC/releases/latest"; // DivineMC - private static int distance = -2; public int distance() { return distance; } + private static int distance = DISTANCE_UNKNOWN; public int distance() { return distance; } // Purpur end - private static @Nullable String mcVer; @Override public long getCacheTime() { @@ -75,70 +85,65 @@ index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..fb3d33117279df26ddd55005d16f80b6 + return 600000; // DivineMC - Decrease cache time to 10 minutes } - @Nonnull @Override - public Component getVersionMessage(@Nonnull String serverVersion) { -- String[] parts = serverVersion.substring("git-Purpur-".length()).split("[-\\s]"); // Purpur -- final Component updateMessage = getUpdateStatusMessage("PurpurMC/Purpur", "ver/" + getMinecraftVersion(), parts[0]); // Purpur -+ String[] parts = serverVersion.substring("git-DivineMC-".length()).split("[-\\s]"); // DivineMC -+ final Component updateMessage = getUpdateStatusMessage("DivineMC/DivineMC", "ver/" + getMinecraftVersion(), parts[0]); // DivineMC - final Component history = getHistory(); +@@ -52,7 +52,7 @@ public class PaperVersionFetcher implements VersionFetcher { + 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("PurpurMC/Purpur", build); // Purpur ++ updateMessage = getUpdateStatusMessage("DivineMC/DivineMC", build); // DivineMC + } + final @Nullable Component history = this.getHistory(); - return history != null ? Component.join(net.kyori.adventure.text.JoinConfiguration.separator(Component.newline()), history, updateMessage) : updateMessage; // Purpur -@@ -47,7 +47,7 @@ public class PaperVersionFetcher implements VersionFetcher { - String result = matcher.group(); - mcVer = result.substring(0, result.length() - 2); // strip 'R' anchor and trailing '-' - } else { -- org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to Purpur!"); // Purpur -+ org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to DivineMC!"); // DivineMC - org.bukkit.Bukkit.getLogger().warning("Pattern: " + VER_PATTERN.toString()); - org.bukkit.Bukkit.getLogger().warning("Version: " + org.bukkit.Bukkit.getBukkitVersion()); - } -@@ -57,14 +57,14 @@ public class PaperVersionFetcher implements VersionFetcher { - } +@@ -62,16 +62,13 @@ public class PaperVersionFetcher implements VersionFetcher { + private static Component getUpdateStatusMessage(final String repo, final ServerBuildInfo build) { + //int distance = DISTANCE_ERROR; // Purpur - use field - private static Component getUpdateStatusMessage(@Nonnull String repo, @Nonnull String branch, @Nonnull String versionInfo) { -- //int distance; // Purpur - use field +- final OptionalInt buildNumber = build.buildNumber(); +- if (buildNumber.isPresent()) { +- distance = fetchDistanceFromSiteApi(build, buildNumber.getAsInt()); +- } else { +- final Optional gitBranch = build.gitBranch(); +- final Optional gitCommit = build.gitCommit(); +- if (gitBranch.isPresent() && gitCommit.isPresent()) { +- distance = fetchDistanceFromGitHub(repo, gitBranch.get(), gitCommit.get()); +- } + // DivineMC start - Branding - try { -- int jenkinsBuild = Integer.parseInt(versionInfo); -- distance = fetchDistanceFromSiteApi(jenkinsBuild, getMinecraftVersion()); -- } catch (NumberFormatException ignored) { - versionInfo = versionInfo.replace("\"", ""); - distance = fetchDistanceFromGitHub(repo, branch, versionInfo); -+ } catch (Exception ex) { -+ org.bukkit.Bukkit.getLogger().warning("Error obtaining version information! Report to DivineMC!"); ++ final Optional gitBranch = build.gitBranch(); ++ final Optional gitCommit = build.gitCommit(); ++ if (gitBranch.isPresent() && gitCommit.isPresent()) { ++ distance = fetchDistanceFromGitHub(repo, gitBranch.get(), gitCommit.get()); } + // DivineMC end - switch (distance) { - case -1: -@@ -83,26 +83,6 @@ public class PaperVersionFetcher implements VersionFetcher { - } + return switch (distance) { + case DISTANCE_ERROR -> text("* Error obtaining version information", NamedTextColor.RED); // Purpur +@@ -86,26 +83,6 @@ public class PaperVersionFetcher implements VersionFetcher { + }; } -- private static int fetchDistanceFromSiteApi(int jenkinsBuild, @Nullable String siteApiVersion) { -- if (siteApiVersion == null) { return -1; } +- private static int fetchDistanceFromSiteApi(final ServerBuildInfo build, final int jenkinsBuild) { - try { -- try (BufferedReader reader = Resources.asCharSource( -- new URL("https://api.purpurmc.org/v2/purpur/" + siteApiVersion), // Purpur +- try (final BufferedReader reader = Resources.asCharSource( +- URI.create("https://api.purpurmc.org/v2/purpur/" + build.minecraftVersionId()).toURL(), // Purpur - Charsets.UTF_8 - ).openBufferedStream()) { -- JsonObject json = new Gson().fromJson(reader, JsonObject.class); -- int latest = json.getAsJsonObject("builds").getAsJsonPrimitive("latest").getAsInt(); // Purpur +- final JsonObject json = new Gson().fromJson(reader, JsonObject.class); +- //final JsonArray builds = json.getAsJsonArray("builds"); // Purpur +- final int latest = json.getAsJsonObject("builds").getAsJsonPrimitive("latest").getAsInt(); // Purpur - return latest - jenkinsBuild; -- } catch (JsonSyntaxException ex) { -- ex.printStackTrace(); -- return -1; +- } catch (final JsonSyntaxException ex) { +- LOGGER.error("Error parsing json from Purpur's downloads API", ex); // Purpur +- return DISTANCE_ERROR; - } -- } catch (IOException e) { -- e.printStackTrace(); -- return -1; +- } catch (final IOException e) { +- LOGGER.error("Error while parsing version", e); +- return DISTANCE_ERROR; - } - } - // Contributed by Techcable in GH-65 - private static int fetchDistanceFromGitHub(@Nonnull String repo, @Nonnull String branch, @Nonnull String hash) { + private static int fetchDistanceFromGitHub(final String repo, final String branch, final String hash) { try { diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java index 3cb56595822799926a8141e60a42f5d1edfc6de5..05478a1ea04ec0396bc8c97090edef4a2aced2a9 100644 @@ -153,6 +158,30 @@ index 3cb56595822799926a8141e60a42f5d1edfc6de5..05478a1ea04ec0396bc8c97090edef4a .variable(LineReader.HISTORY_FILE, java.nio.file.Paths.get(".console_history")) .completer(new ConsoleCommandCompleter(this.server)) .option(LineReader.Option.COMPLETE_IN_WORD, true); +diff --git a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java +index a6e5950b5875cafd734300cdfbf58f5d3736f3c8..3c2102bd861f65474968a51d379993efc639bdc3 100644 +--- a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java ++++ b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java +@@ -32,6 +32,7 @@ public record ServerBuildInfoImpl( + + private static final String BRAND_PAPER_NAME = "Paper"; + private static final String BRAND_PURPUR_NAME = "Purpur"; // Purpur ++ private static final String BRAND_DIVINEMC_NAME = "DivineMC"; // DivineMC + + private static final String BUILD_DEV = "DEV"; + +@@ -43,9 +44,9 @@ public record ServerBuildInfoImpl( + this( + getManifestAttribute(manifest, ATTRIBUTE_BRAND_ID) + .map(Key::key) +- .orElse(BRAND_PURPUR_ID), // Purpur ++ .orElse(BRAND_DIVINEMC_ID), // DivineMC + getManifestAttribute(manifest, ATTRIBUTE_BRAND_NAME) +- .orElse(BRAND_PURPUR_NAME), // Purpur ++ .orElse(BRAND_DIVINEMC_NAME), // Purpur + SharedConstants.getCurrentVersion().getId(), + SharedConstants.getCurrentVersion().getName(), + getManifestAttribute(manifest, ATTRIBUTE_BUILD_NUMBER) diff --git a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java index 8f74c2ec5252b6265549589310d742337c91cb2c..1f4c965531393dd81246de487bc86f6d6f73b723 100644 --- a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java @@ -184,19 +213,6 @@ index 8f74c2ec5252b6265549589310d742337c91cb2c..1f4c965531393dd81246de487bc86f6d server.halt(true); servergui.runFinalizers(); } -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b82c66c402823874e3a5fc9bb7b1df73c708aec5..2f934d807a0b005fcf682ad2aa97b783b0a2169a 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -269,7 +269,7 @@ import javax.annotation.Nullable; // Paper - import javax.annotation.Nonnull; // Paper - - public final class CraftServer implements Server { -- private final String serverName = "Purpur"; // Paper // Pufferfish // Purpur -+ private final String serverName = "DivineMC"; // Paper // Pufferfish // Purpur // DivineMC - private final String serverVersion; - private final String bukkitVersion = Versioning.getBukkitVersion(); - private final Logger logger = Logger.getLogger("Minecraft"); diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..7bbbdf2895776f12ebc153dc83f4d53be8f06c7c 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java @@ -210,19 +226,6 @@ index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..7bbbdf2895776f12ebc153dc83f4d53b Properties properties = new Properties(); if (stream != null) { -diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index de70bfdbdd7740fdf20dd063a7a623a9e96cef98..bcdd2bc6ffc91349ac75833bd3928e8ca7de7a0f 100644 ---- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java -+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -@@ -231,7 +231,7 @@ public class PurpurConfig { - deathMessageOnlyBroadcastToAffectedPlayer = getBoolean("settings.broadcasts.death.only-broadcast-to-affected-player", deathMessageOnlyBroadcastToAffectedPlayer); - } - -- public static String serverModName = "Purpur"; -+ public static String serverModName = "DivineMC"; // DivineMC - private static void serverModName() { - serverModName = getString("settings.server-mod-name", serverModName); - } diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java index a353eb9f45af7b7f9bfd92a4a89403335b841840..20775a8c668c44111104b149a532dfedf691f405 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java diff --git a/patches/server/0002-Divine-Configuration.patch b/patches/server/0002-Divine-Configuration.patch index dc539b7..5dcb3d4 100644 --- a/patches/server/0002-Divine-Configuration.patch +++ b/patches/server/0002-Divine-Configuration.patch @@ -62,19 +62,19 @@ index eda2f8cc034cf46293be1be117a60cf8b663c303..6a3c349cb36a0c89747cf4665e7bc272 this.generator = gen; 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 2f934d807a0b005fcf682ad2aa97b783b0a2169a..5905ea67e79c46b90c60b191a0967e07fee4606e 100644 +index ccdf1b7b86895fe469476112277b5f76f7f02bf0..dd0f1013f3de00d67e6b3d69ed09176176bc6a0b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -268,6 +268,8 @@ import net.md_5.bungee.api.chat.BaseComponent; // Spigot +@@ -263,6 +263,8 @@ import net.md_5.bungee.api.chat.BaseComponent; // Spigot import javax.annotation.Nullable; // Paper import javax.annotation.Nonnull; // Paper +import space.bxteam.divinemc.configuration.DivineConfig; // DivineMC + public final class CraftServer implements Server { - private final String serverName = "DivineMC"; // Paper // Pufferfish // Purpur // DivineMC + private final String serverName = io.papermc.paper.ServerBuildInfo.buildInfo().brandName(); // Paper private final String serverVersion; -@@ -1053,6 +1055,7 @@ public final class CraftServer implements Server { +@@ -1048,6 +1050,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 @@ -82,7 +82,7 @@ index 2f934d807a0b005fcf682ad2aa97b783b0a2169a..5905ea67e79c46b90c60b191a0967e07 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)) -@@ -1069,6 +1072,7 @@ public final class CraftServer implements Server { +@@ -1064,6 +1067,7 @@ public final class CraftServer implements Server { } world.spigotConfig.init(); // Spigot world.purpurConfig.init(); // Purpur @@ -90,7 +90,7 @@ index 2f934d807a0b005fcf682ad2aa97b783b0a2169a..5905ea67e79c46b90c60b191a0967e07 } Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper -@@ -1086,6 +1090,7 @@ public final class CraftServer implements Server { +@@ -1081,6 +1085,7 @@ public final class CraftServer implements Server { org.spigotmc.SpigotConfig.registerCommands(); // Spigot io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper org.purpurmc.purpur.PurpurConfig.registerCommands(); // Purpur @@ -98,7 +98,7 @@ index 2f934d807a0b005fcf682ad2aa97b783b0a2169a..5905ea67e79c46b90c60b191a0967e07 this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -@@ -3117,6 +3122,13 @@ public final class CraftServer implements Server { +@@ -3112,6 +3117,13 @@ public final class CraftServer implements Server { } // Purpur end @@ -113,10 +113,10 @@ index 2f934d807a0b005fcf682ad2aa97b783b0a2169a..5905ea67e79c46b90c60b191a0967e07 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 a0a7bfe8f5a40b945b83096de1efd650adeb9ee3..248405f9c0290b16a580d16bc3cb824cc9f53bc2 100644 +index 6d8e9cf4ee496b8748654e792ce438f512c3d946..d62bb6611ec37ec9c35712810cc65a60cb88ed6e 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -183,6 +183,14 @@ public class Main { +@@ -184,6 +184,14 @@ public class Main { .describedAs("Yml file"); // Purpur end diff --git a/patches/server/0021-Optimize-CraftServer.getWorld-UUID.patch b/patches/server/0021-Optimize-CraftServer.getWorld-UUID.patch index fca7bb2..46dfbde 100644 --- a/patches/server/0021-Optimize-CraftServer.getWorld-UUID.patch +++ b/patches/server/0021-Optimize-CraftServer.getWorld-UUID.patch @@ -6,18 +6,18 @@ Subject: [PATCH] Optimize CraftServer.getWorld(UUID) Original code by MultiPaper - https://github.com/MultiPaper/MultiPaper diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 5905ea67e79c46b90c60b191a0967e07fee4606e..978146aaf5ec11b82c41ecc9f766d6e6045958cf 100644 +index dd0f1013f3de00d67e6b3d69ed09176176bc6a0b..9d3d7118bae9315b08291e3f5a2052e2100c0037 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -269,6 +269,7 @@ import javax.annotation.Nullable; // Paper +@@ -264,6 +264,7 @@ import javax.annotation.Nullable; // Paper import javax.annotation.Nonnull; // Paper import space.bxteam.divinemc.configuration.DivineConfig; // DivineMC +import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; // DivineMC public final class CraftServer implements Server { - private final String serverName = "DivineMC"; // Paper // Pufferfish // Purpur // DivineMC -@@ -287,6 +288,7 @@ public final class CraftServer implements Server { + private final String serverName = io.papermc.paper.ServerBuildInfo.buildInfo().brandName(); // Paper +@@ -282,6 +283,7 @@ public final class CraftServer implements Server { protected final DedicatedPlayerList playerList; private final Map worlds = new LinkedHashMap(); // private final Map, Registry> registries = new HashMap<>(); // Paper - replace with RegistryAccess @@ -25,7 +25,7 @@ index 5905ea67e79c46b90c60b191a0967e07fee4606e..978146aaf5ec11b82c41ecc9f766d6e6 private YamlConfiguration configuration; private YamlConfiguration commandsConfiguration; private final Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions())); -@@ -1474,6 +1476,7 @@ public final class CraftServer implements Server { +@@ -1469,6 +1471,7 @@ public final class CraftServer implements Server { this.getLogger().log(Level.SEVERE, null, ex); } @@ -33,7 +33,7 @@ index 5905ea67e79c46b90c60b191a0967e07fee4606e..978146aaf5ec11b82c41ecc9f766d6e6 this.worlds.remove(world.getName().toLowerCase(java.util.Locale.ENGLISH)); this.console.removeLevel(handle); return true; -@@ -1492,6 +1495,7 @@ public final class CraftServer implements Server { +@@ -1487,6 +1490,7 @@ public final class CraftServer implements Server { @Override public World getWorld(UUID uid) { @@ -41,7 +41,7 @@ index 5905ea67e79c46b90c60b191a0967e07fee4606e..978146aaf5ec11b82c41ecc9f766d6e6 for (World world : this.worlds.values()) { if (world.getUID().equals(uid)) { return world; -@@ -1515,6 +1519,7 @@ public final class CraftServer implements Server { +@@ -1510,6 +1514,7 @@ public final class CraftServer implements Server { System.out.println("World " + world.getName() + " is a duplicate of another world and has been prevented from loading. Please delete the uid.dat file from " + world.getName() + "'s world directory if you want to be able to load the duplicate world."); return; } diff --git a/patches/server/0035-Delete-Timings.patch b/patches/server/0035-Delete-Timings.patch index 3dd140a..df46756 100644 --- a/patches/server/0035-Delete-Timings.patch +++ b/patches/server/0035-Delete-Timings.patch @@ -842,7 +842,7 @@ index 8c134a642ccaf3530022f2e675a858d726e1dda4..d6daa27a8d7aca00b181e90d789f4249 } 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 dfe3d28bd97d1335457d1005ecf69afe75d5ff80..2720d080ab34d7ced08cc54852a1e489c1f72e90 100644 +index 71705ccbc0cce88382b1fb536271773a332ad3a2..eca0c8afe003e0c3155aded8b5a9855ad0952e60 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -3,7 +3,6 @@ package net.minecraft.server; @@ -853,7 +853,7 @@ index dfe3d28bd97d1335457d1005ecf69afe75d5ff80..2720d080ab34d7ced08cc54852a1e489 import com.destroystokyo.paper.event.server.PaperServerListPingEvent; import com.google.common.base.Stopwatch; import com.google.common.collect.Lists; -@@ -193,8 +192,6 @@ import org.bukkit.craftbukkit.Main; +@@ -190,8 +189,6 @@ import org.bukkit.craftbukkit.CraftRegistry; import org.bukkit.event.server.ServerLoadEvent; // CraftBukkit end @@ -862,7 +862,7 @@ index dfe3d28bd97d1335457d1005ecf69afe75d5ff80..2720d080ab34d7ced08cc54852a1e489 public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements ServerInfo, CommandSource, AutoCloseable { private static MinecraftServer SERVER; // Paper -@@ -981,7 +978,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop