diff --git a/patches/server/0003-Rebrand.patch b/patches/server/0003-Rebrand.patch index 51d477256..92e48d560 100644 --- a/patches/server/0003-Rebrand.patch +++ b/patches/server/0003-Rebrand.patch @@ -35,7 +35,7 @@ index feaff0406fa47ffb265ce316b057fb52aa367870..279e1cfd24f29d3ac55e74759d8b542a "Specification-Title" to "Bukkit", "Specification-Version" to project.version, diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java -index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..218d3a4147cab29937ad67a963e21ac1730daaa0 100644 +index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..5eefe30d47b055fd544caebfb77f6f5a12894fda 100644 --- a/src/main/java/com/destroystokyo/paper/Metrics.java +++ b/src/main/java/com/destroystokyo/paper/Metrics.java @@ -593,7 +593,7 @@ public class Metrics { @@ -43,7 +43,7 @@ index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..218d3a4147cab29937ad67a963e21ac1 // Only start Metrics, if it's enabled in the config if (config.getBoolean("enabled", true)) { - Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur -+ Metrics metrics = new Metrics("Plazma", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur // Plazma - Rebrand ++ Metrics metrics = new Metrics(org.bukkit.craftbukkit.util.Versioning.BRANDING, serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur // Plazma - Rebrand metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> { String minecraftVersion = Bukkit.getVersion(); @@ -52,15 +52,15 @@ index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..218d3a4147cab29937ad67a963e21ac1 metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size())); metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur - metrics.addCustomChart(new Metrics.SimplePie("purpur_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur -+ metrics.addCustomChart(new Metrics.SimplePie(metrics.name.toLowerCase(Locale.ROOT) + "_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur // Plazma // Plazma - Rebrand ++ metrics.addCustomChart(new Metrics.SimplePie(org.bukkit.craftbukkit.util.Versioning.BRAND_L + "_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur // Plazma // Plazma - Rebrand 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..0a846802f053c545992763e0447e15565204e764 100644 +index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..9404c5fa798b00f5532ed7bda050cf183555709d 100644 --- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -@@ -20,10 +20,15 @@ import java.util.stream.StreamSupport; +@@ -20,7 +20,6 @@ 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 // Purpur start @@ -68,36 +68,27 @@ index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..0a846802f053c545992763e0447e1556 private static int distance = -2; public int distance() { return distance; } // Purpur end private static @Nullable String mcVer; -+ // Plazma start - Rebranding -+ private static final String PROJECT_NAME = "Plazma"; -+ private static final String PROJECT_REPO = "PlazmaMC/PlazmaBukkit"; -+ private static final String DOWNLOAD_PAGE = "https://docs.plazmamc.org/plazma/about/downloads"; -+ public static final boolean DEVELOPMENT = false; -+ // Plazma end - - @Override - public long getCacheTime() { -@@ -33,8 +38,8 @@ public class PaperVersionFetcher implements VersionFetcher { +@@ -33,8 +32,8 @@ public class PaperVersionFetcher implements VersionFetcher { @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--".length() + PROJECT_NAME.length()).split("[-\\s]"); // Purpur // Plazma - Rebrand -+ final Component updateMessage = getUpdateStatusMessage(PROJECT_REPO, (DEVELOPMENT ? "dev/" : "ver/") + getMinecraftVersion(), parts[0]); // Purpur // Plazma - Rebrand ++ String[] parts = serverVersion.substring("git--".length() + org.bukkit.craftbukkit.util.Versioning.BRANDING.length()).split("[-\\s]"); // Purpur // Plazma - Rebrand ++ final Component updateMessage = getUpdateStatusMessage(org.bukkit.craftbukkit.util.Versioning.REPOSITORY, (org.bukkit.craftbukkit.util.Versioning.DEVELOPMENT ? "dev/" : "ver/") + getMinecraftVersion(), parts[0]); // Purpur // Plazma - Rebrand final Component history = getHistory(); return history != null ? Component.join(net.kyori.adventure.text.JoinConfiguration.separator(Component.newline()), history, updateMessage) : updateMessage; // Purpur -@@ -47,7 +52,7 @@ public class PaperVersionFetcher implements VersionFetcher { +@@ -47,7 +46,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 " + PROJECT_NAME + "!"); // Purpur // Plazma // Plazma - Rebrand ++ org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to " + org.bukkit.craftbukkit.util.Versioning.BRANDING + "!"); // Purpur // Plazma // Plazma - Rebrand org.bukkit.Bukkit.getLogger().warning("Pattern: " + VER_PATTERN.toString()); org.bukkit.Bukkit.getLogger().warning("Version: " + org.bukkit.Bukkit.getBukkitVersion()); } -@@ -57,6 +62,7 @@ public class PaperVersionFetcher implements VersionFetcher { +@@ -57,6 +56,7 @@ public class PaperVersionFetcher implements VersionFetcher { } private static Component getUpdateStatusMessage(@Nonnull String repo, @Nonnull String branch, @Nonnull String versionInfo) { @@ -105,7 +96,7 @@ index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..0a846802f053c545992763e0447e1556 //int distance; // Purpur - use field try { int jenkinsBuild = Integer.parseInt(versionInfo); -@@ -65,6 +71,11 @@ public class PaperVersionFetcher implements VersionFetcher { +@@ -65,6 +65,11 @@ public class PaperVersionFetcher implements VersionFetcher { versionInfo = versionInfo.replace("\"", ""); distance = fetchDistanceFromGitHub(repo, branch, versionInfo); } @@ -117,7 +108,15 @@ index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..0a846802f053c545992763e0447e1556 switch (distance) { case -1: -@@ -83,6 +94,7 @@ public class PaperVersionFetcher implements VersionFetcher { +@@ -77,12 +82,13 @@ public class PaperVersionFetcher implements VersionFetcher { + return Component.text("* You are " + distance + " version(s) behind", NamedTextColor.YELLOW) // Purpur + .append(Component.newline()) + .append(Component.text("Download the new version at: ") +- .append(Component.text(DOWNLOAD_PAGE, NamedTextColor.GOLD) ++ .append(Component.text(org.bukkit.craftbukkit.util.Versioning.DOWNLOAD, NamedTextColor.GOLD) // Plazma - Rebranding + .hoverEvent(Component.text("Click to open", NamedTextColor.WHITE)) +- .clickEvent(ClickEvent.openUrl(DOWNLOAD_PAGE)))); ++ .clickEvent(ClickEvent.openUrl(org.bukkit.craftbukkit.util.Versioning.DOWNLOAD)))); // Plazma - Rebranding } } @@ -125,7 +124,7 @@ index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..0a846802f053c545992763e0447e1556 private static int fetchDistanceFromSiteApi(int jenkinsBuild, @Nullable String siteApiVersion) { if (siteApiVersion == null) { return -1; } try { -@@ -102,6 +114,7 @@ public class PaperVersionFetcher implements VersionFetcher { +@@ -102,6 +108,7 @@ public class PaperVersionFetcher implements VersionFetcher { return -1; } } @@ -134,7 +133,7 @@ index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..0a846802f053c545992763e0447e1556 // Contributed by Techcable in GH-65 private static int fetchDistanceFromGitHub(@Nonnull String repo, @Nonnull String branch, @Nonnull String hash) { diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java -index 3cb56595822799926a8141e60a42f5d1edfc6de5..aa5f7dbaa62d83168055f2d389ba1ed512d1741b 100644 +index 3cb56595822799926a8141e60a42f5d1edfc6de5..f92edc10fb0f7a00436fd66d1fd1a9a45fb88b95 100644 --- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java +++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java @@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole { @@ -142,12 +141,12 @@ index 3cb56595822799926a8141e60a42f5d1edfc6de5..aa5f7dbaa62d83168055f2d389ba1ed5 protected LineReader buildReader(LineReaderBuilder builder) { builder - .appName("Purpur") // Purpur -+ .appName("Plazma") // Purpur // Plazma - Rebrand ++ .appName(org.bukkit.craftbukkit.util.Versioning.BRANDING) // Purpur // Plazma - Rebrand .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/configuration/Configurations.java b/src/main/java/io/papermc/paper/configuration/Configurations.java -index 96142deb42700f888ea08689ab62c27ef2b881fd..44dda308913d8d25e53d8d0fc7e50c0c678b76d0 100644 +index 96142deb42700f888ea08689ab62c27ef2b881fd..f5d725feb6d32f947eed82073c5594e205f31afe 100644 --- a/src/main/java/io/papermc/paper/configuration/Configurations.java +++ b/src/main/java/io/papermc/paper/configuration/Configurations.java @@ -114,7 +114,11 @@ public abstract class Configurations { @@ -156,7 +155,7 @@ index 96142deb42700f888ea08689ab62c27ef2b881fd..44dda308913d8d25e53d8d0fc7e50c0c if (ex.getCause() instanceof AccessDeniedException) { - LOGGER.warn("Could not save {}: Paper could not persist the full set of configuration settings in the configuration file. Any setting missing from the configuration file will be set with its default value in memory. Admins should make sure to review the configuration documentation at https://docs.papermc.io/paper/configuration for more details.", filename, ex); + // Plazma start - Rebrand -+ LOGGER.warn("Could not save {}: Plazma could not persist the full set of configuration settings in the configuration file." ++ LOGGER.warn("Could not save {}: " + org.bukkit.craftbukkit.util.Versioning.DOWNLOAD + " could not persist the full set of configuration settings in the configuration file." + + "Any setting missing from the configuration file will be set with its default value in memory." + + "Admins should make sure to review the configuration documentation at https://docs.papermc.io/paper/configuration for more details.", filename, ex); // TODO: Change to Plazma document link + // Plazma end - Rebrand @@ -164,32 +163,24 @@ index 96142deb42700f888ea08689ab62c27ef2b881fd..44dda308913d8d25e53d8d0fc7e50c0c } } diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java -index c366d84518979e842a6f10f969a5951539ecac93..246c5d1abc797b7679820b54ab0b4bafd858ce42 100644 +index c366d84518979e842a6f10f969a5951539ecac93..bc273804a60542efb284409680c6849d165dedaa 100644 --- a/src/main/java/net/minecraft/CrashReport.java +++ b/src/main/java/net/minecraft/CrashReport.java -@@ -22,6 +22,7 @@ import org.slf4j.Logger; - - public class CrashReport { - -+ private static final String PROJECT_NAME = "Plazma"; // Plazma - Rebranding - private static final Logger LOGGER = LogUtils.getLogger(); - private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss", Locale.ROOT); - private final String title; -@@ -37,7 +38,7 @@ public class CrashReport { +@@ -37,7 +37,7 @@ public class CrashReport { io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateThrowable(cause); // Paper this.title = message; this.exception = cause; - this.systemReport.setDetail("CraftBukkit Information", new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit -+ this.systemReport.setDetail(PROJECT_NAME + " Information", new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit // Plazma - Rebranding ++ this.systemReport.setDetail(org.bukkit.craftbukkit.util.Versioning.BRANDING + " Information", new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit // Plazma - Rebranding } public String getTitle() { -@@ -127,7 +128,7 @@ public class CrashReport { +@@ -127,7 +127,7 @@ public class CrashReport { stringbuilder.append("---- Minecraft Crash Report ----\n"); // Purpur start stringbuilder.append("// "); - stringbuilder.append("// DO NOT REPORT THIS TO PAPER! REPORT TO PURPUR INSTEAD!"); -+ stringbuilder.append("// DO NOT REPORT THIS TO PAPER OR PURPUR! REPORT TO " + PROJECT_NAME.toUpperCase(Locale.ROOT) + " INSTEAD!"); // Plazma - Rebranding ++ stringbuilder.append("// DO NOT REPORT THIS TO PAPER OR PURPUR! REPORT TO " + org.bukkit.craftbukkit.util.Versioning.BRAND_U + " INSTEAD!"); // Plazma - Rebranding // Purpur end stringbuilder.append("// "); stringbuilder.append(CrashReport.getErrorComment()); @@ -234,49 +225,40 @@ index 411f1f8c6be072cfc5ba88cbec38dbc4300a41d1..0fb3eeab083a0b1e9b495bd2c5c556fc Main.LOGGER.error(awtException); return; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index dfeae138e830e95ab823b6349a91160b02622208..b797f719acb2258bee1cc93394561f14a9df5296 100644 +index 21327a92b75a460c7beb3aa408502f37a7db31fa..6d549448e67a110a42dde6f8eeaab1f0033f3462 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -198,6 +198,8 @@ import co.aikar.timings.MinecraftTimings; // Paper - public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements ServerInfo, CommandSource, AutoCloseable { - - private static MinecraftServer SERVER; // Paper -+ private static final String BRANDING = "Plazma"; // Plazma - Rebranding -+ private static final String GETTING_STARTED = "https://docs.plazmamc.org/plazma/administration/getting-started"; // Plazma - Rebranding - public static final Logger LOGGER = LogUtils.getLogger(); - public static final net.kyori.adventure.text.logger.slf4j.ComponentLogger COMPONENT_LOGGER = net.kyori.adventure.text.logger.slf4j.ComponentLogger.logger(LOGGER.getName()); // Paper - public static final String VANILLA_BRAND = "vanilla"; -@@ -496,8 +498,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.server.getQueryPlugins()) { diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java -index 842f382de43df5d5c321422372ec30ccdd7859d7..d43ebcf4448240f86eca1a4127b534851e7b9618 100644 +index 842f382de43df5d5c321422372ec30ccdd7859d7..55e16ed1151c5d53f492581f66a3406ac418b653 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java @@ -56,12 +56,12 @@ public class DedicatedServerProperties extends Settings finalizers = Lists.newArrayList(); -@@ -56,7 +59,7 @@ public class MinecraftServerGui extends JComponent { +@@ -56,7 +58,7 @@ public class MinecraftServerGui extends JComponent { ; } @@ -334,7 +315,7 @@ index 8f74c2ec5252b6265549589310d742337c91cb2c..6a6a772c1d0bc9b4889014407454a891 final MinecraftServerGui servergui = new MinecraftServerGui(server); jframe.setDefaultCloseOperation(2); -@@ -64,7 +67,7 @@ public class MinecraftServerGui extends JComponent { +@@ -64,7 +66,7 @@ public class MinecraftServerGui extends JComponent { jframe.pack(); jframe.setLocationRelativeTo((Component) null); jframe.setVisible(true); @@ -343,7 +324,7 @@ index 8f74c2ec5252b6265549589310d742337c91cb2c..6a6a772c1d0bc9b4889014407454a891 // Paper start - Improve ServerGUI try { -@@ -76,7 +79,7 @@ public class MinecraftServerGui extends JComponent { +@@ -76,7 +78,7 @@ public class MinecraftServerGui extends JComponent { jframe.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent windowevent) { if (!servergui.isClosing.getAndSet(true)) { @@ -352,17 +333,17 @@ index 8f74c2ec5252b6265549589310d742337c91cb2c..6a6a772c1d0bc9b4889014407454a891 server.halt(true); servergui.runFinalizers(); } -@@ -123,7 +126,7 @@ public class MinecraftServerGui extends JComponent { +@@ -123,7 +125,7 @@ public class MinecraftServerGui extends JComponent { // Paper start - Add onboarding message for initial server start private JComponent buildOnboardingPanel() { - String onboardingLink = "https://docs.papermc.io/paper/next-steps"; -+ String onboardingLink = GETTING_STARTED; // Plazma - Rebranding ++ String onboardingLink = org.bukkit.craftbukkit.util.Versioning.STEPUP; // Plazma - Rebranding JPanel jPanel = new JPanel(); javax.swing.JLabel jLabel = new javax.swing.JLabel("If you need help setting up your server you can visit:"); diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -index f6e3b745fc417354380d4a969f83aee430bad785..ce0686759f0c32e9ffcb26f99503215a49873b91 100644 +index f6e3b745fc417354380d4a969f83aee430bad785..d2795cacee1b3dd2d73ec91553bb8aa3206db74a 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java @@ -155,7 +155,7 @@ public class RegionFileStorage implements AutoCloseable { @@ -370,7 +351,7 @@ index f6e3b745fc417354380d4a969f83aee430bad785..ce0686759f0c32e9ffcb26f99503215a // Paper start private static void printOversizedLog(String msg, Path file, int x, int z) { - org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PAPER - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); -+ org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PLAZMA - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); // Plazma - Rebrand ++ org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO " + org.bukkit.craftbukkit.util.Versioning.BRANDING + " - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); // Plazma - Rebrand } private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException { @@ -388,7 +369,7 @@ index 19937ffa2c93cb75ea8dba58dd5a8214adc035fa..c3805881b675b5c2171a6aadbd2c9057 private final String bukkitVersion = Versioning.getBukkitVersion(); private final Logger logger = Logger.getLogger("Minecraft"); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index a0a7bfe8f5a40b945b83096de1efd650adeb9ee3..0d31b43cc7d319accaaf5548df8ea88dcd05a903 100644 +index a0a7bfe8f5a40b945b83096de1efd650adeb9ee3..369543328531b0bd12c76aa8552e565bc40b51f7 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -142,7 +142,7 @@ public class Main { @@ -396,7 +377,7 @@ index a0a7bfe8f5a40b945b83096de1efd650adeb9ee3..0d31b43cc7d319accaaf5548df8ea88d this.acceptsAll(Main.asList("noconsole"), "Disables the console"); - this.acceptsAll(Main.asList("v", "version"), "Show the CraftBukkit Version"); -+ this.acceptsAll(Main.asList("v", "version"), "Show the Plazma Version"); // Plazma - Rebrand ++ this.acceptsAll(Main.asList("v", "version"), "Show the " + org.bukkit.craftbukkit.util.Versioning.BRANDING + " Version"); // Plazma - Rebrand this.acceptsAll(Main.asList("demo"), "Demo mode"); @@ -405,7 +386,7 @@ index a0a7bfe8f5a40b945b83096de1efd650adeb9ee3..0d31b43cc7d319accaaf5548df8ea88d .withRequiredArg() .ofType(String.class) - .defaultsTo("Unknown Server") -+ .defaultsTo("A Plazma Server") // Plazma - Rebrand ++ .defaultsTo("A " + org.bukkit.craftbukkit.util.Versioning.BRANDING + " Server") // Plazma - Rebrand .describedAs("Name"); // Paper end } @@ -427,7 +408,7 @@ index a0a7bfe8f5a40b945b83096de1efd650adeb9ee3..0d31b43cc7d319accaaf5548df8ea88d } diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -index ca8ae8e1c51b937dac916e0b0dc94b5e2e61efeb..2058af0975e510b3f86d7dbb1811062b9b0dc342 100644 +index ca8ae8e1c51b937dac916e0b0dc94b5e2e61efeb..324495c8be1a54434e7c73158d7d20dba625b7f7 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java @@ -503,7 +503,7 @@ public class CraftScheduler implements BukkitScheduler { @@ -435,15 +416,22 @@ index ca8ae8e1c51b937dac916e0b0dc94b5e2e61efeb..2058af0975e510b3f86d7dbb1811062b } else { // this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper - task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Purpur"); // Paper // Purpur -+ task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Plazma"); // Paper // Purpur // Plazma - Rebrand ++ task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to " + org.bukkit.craftbukkit.util.Versioning.BRANDING + "."); // Paper // Purpur // Plazma - Rebrand // We don't need to parse pending // (async tasks must live with race-conditions if they attempt to cancel between these few lines of code) } diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java -index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..0aa8dfa94368fb119644760e3686a7c01f510456 100644 +index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..85265c28d2e5369c812ec856855183a98908680c 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java -@@ -8,22 +8,25 @@ import java.util.logging.Logger; +@@ -2,28 +2,40 @@ package org.bukkit.craftbukkit.util; + + import java.io.IOException; + import java.io.InputStream; ++import java.util.Locale; + import java.util.Properties; + import java.util.logging.Level; + import java.util.logging.Logger; import org.bukkit.Bukkit; public final class Versioning { @@ -451,8 +439,16 @@ index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..0aa8dfa94368fb119644760e3686a7c0 - String result = "Unknown-Version"; - - InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Pufferfish // Purpur -+ // Plazma start - Rebrand & Improve Versioning -+ public static String version = "Unknown-Version"; ++ // Plazma start - Rebrand; Branding utils ++ private static String version = "Unknown-Version"; ++ public static final String BRANDING = "Plazma"; ++ public static final String BRAND_L = BRANDING.toLowerCase(Locale.ROOT); ++ public static final String BRAND_U = BRANDING.toUpperCase(Locale.ROOT); ++ public static final String DOWNLOAD = "https://plazmamc.org/downloads"; ++ public static final String REPOSITORY = "PlazmaMC/PlazmaBukkit"; ++ public static final String DOCUMENT = "https://docs.plazmamc.org/plazma/administration/getting-started"; ++ public static final String STEPUP = "https://docs.plazmamc.org/plazma/administration/getting-started/next-step"; ++ public static final boolean DEVELOPMENT = false; + static { + InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.plazmamc.plazma/plazma-api/pom.properties"); Properties properties = new Properties(); @@ -474,10 +470,10 @@ index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..0aa8dfa94368fb119644760e3686a7c0 + public static String getBukkitVersion() { + return version; } -+ // Plazma end - Rebrand & Improve Versioning ++ // Plazma end - Rebranding; Branding utils } diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index f49108ed94f7787347c5e0a721646083d6dffafc..9311fcb675d20ee77d225e3cffe1d6ce56601963 100644 +index de70bfdbdd7740fdf20dd063a7a623a9e96cef98..85f4a9300aebfd4ee64d179dfa1f7ffd314cb3b8 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 { @@ -485,71 +481,62 @@ index f49108ed94f7787347c5e0a721646083d6dffafc..9311fcb675d20ee77d225e3cffe1d6ce } - public static String serverModName = "Purpur"; -+ public static String serverModName = "Plazma"; // Plazma - Rebrand ++ public static String serverModName = org.bukkit.craftbukkit.util.Versioning.BRANDING; // Plazma - Rebrand 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..effcdfcc5d817e2c4b77862978ab8545068bc0c8 100644 +index a353eb9f45af7b7f9bfd92a4a89403335b841840..e9203846793c3e16099556b10e5cf99376474f13 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java -@@ -11,6 +11,8 @@ import org.bukkit.Bukkit; - public final class WatchdogThread extends io.papermc.paper.util.TickThread // Paper - rewrite chunk system - { - -+ private static final String BRANDING = "Plazma"; // Plazma - Rebranding -+ private static final String REPOSITORY = "https://git.plazmamc.org/1.20.6"; // Plazma - Rebranding - public static final boolean DISABLE_WATCHDOG = Boolean.getBoolean("disable.watchdog"); // Paper - private static WatchdogThread instance; - private long timeoutTime; -@@ -96,7 +98,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa +@@ -96,7 +96,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa private WatchdogThread(long timeoutTime, boolean restart) { - super( "Watchdog Thread" ); // Purpur - use a generic name -+ super( BRANDING + " Watchdog Thread" ); // Purpur - use a generic name // Plazma - Rebranding; nah we dont ++ super( org.bukkit.craftbukkit.util.Versioning.BRANDING + " Watchdog Thread" ); // Purpur - use a generic name // Plazma - Rebranding; nah we dont this.timeoutTime = timeoutTime; this.restart = restart; earlyWarningEvery = Math.min(io.papermc.paper.configuration.GlobalConfiguration.get().watchdog.earlyWarningEvery, timeoutTime); // Paper -@@ -155,14 +157,14 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa +@@ -155,14 +155,14 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa if (isLongTimeout) { // Paper end log.log( Level.SEVERE, "------------------------------" ); - log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Purpur bug." ); // Paper // Purpur -+ log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a " + BRANDING + " bug." ); // Paper // Purpur // Plazma - Rebrand ++ log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a " + org.bukkit.craftbukkit.util.Versioning.BRANDING + " bug." ); // Paper // Purpur // Plazma - Rebrand log.log( Level.SEVERE, "If you see a plugin in the Server thread dump below, then please report it to that author" ); log.log( Level.SEVERE, "\t *Especially* if it looks like HTTP or MySQL operations are occurring" ); log.log( Level.SEVERE, "If you see a world save or edit, then it means you did far more than your server can handle at once" ); log.log( Level.SEVERE, "\t If this is the case, consider increasing timeout-time in spigot.yml but note that this will replace the crash with LARGE lag spikes" ); - log.log( Level.SEVERE, "If you are unsure or still think this is a Purpur bug, please report this to https://github.com/PurpurMC/Purpur/issues" ); // Purpur -+ log.log( Level.SEVERE, "If you are unsure or still think this is a " + BRANDING + " bug, please report this to " + REPOSITORY ); // Purpur // Plazma - Rebrand ++ log.log( Level.SEVERE, "If you are unsure or still think this is a " + org.bukkit.craftbukkit.util.Versioning.BRANDING + " bug, please report this to " + org.bukkit.craftbukkit.util.Versioning.REPOSITORY ); // Purpur // Plazma - Rebrand log.log( Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports" ); - log.log( Level.SEVERE, "Purpur version: " + Bukkit.getServer().getVersion() ); // Purpur + log.log( Level.SEVERE, "Plazma version: " + Bukkit.getServer().getVersion() ); // Purpur // Plazma - Rebrand // if ( net.minecraft.world.level.Level.lastPhysicsProblem != null ) { -@@ -184,12 +186,12 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa +@@ -184,12 +184,12 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa // Paper end } else { - log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur -+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO " + BRANDING.toUpperCase() + " - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur // Plazma - Rebrand ++ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO " + org.bukkit.craftbukkit.util.Versioning.BRAND_U + " - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur // Plazma - Rebrand log.log(Level.SEVERE, "The server has not responded for " + (currentTime - lastTick) / 1000 + " seconds! Creating thread dump"); } // Paper end - Different message for short timeout log.log( Level.SEVERE, "------------------------------" ); - log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Purpur!):" ); // Paper // Purpur -+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to " + BRANDING + "!):" ); // Paper // Purpur // Plazma - Rebrand ++ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to " + org.bukkit.craftbukkit.util.Versioning.BRANDING + "!):" ); // Paper // Purpur // Plazma - Rebrand io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper - rewrite chunk system this.dumpTickingInfo(); // Paper - log detailed tick information WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log ); -@@ -205,7 +207,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa +@@ -205,7 +205,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa WatchdogThread.dumpThread( thread, log ); } } else { - log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH ---"); // Purpur -+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO " + BRANDING.toUpperCase() + " - THIS IS NOT A BUG OR A CRASH ---"); // Purpur // Plazma - Rebrand ++ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO " + org.bukkit.craftbukkit.util.Versioning.BRAND_U + " - THIS IS NOT A BUG OR A CRASH ---"); // Purpur // Plazma - Rebrand } log.log( Level.SEVERE, "------------------------------" ); diff --git a/patches/server/0005-Plazma-Configurations.patch b/patches/server/0005-Plazma-Configurations.patch index fef87d8a1..f07fbdc02 100644 --- a/patches/server/0005-Plazma-Configurations.patch +++ b/patches/server/0005-Plazma-Configurations.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Plazma Configurations diff --git a/build.gradle.kts b/build.gradle.kts -index e6b6d1f26fd673f35f66a09a64c83810e092e757..1bccc21fa2130e577bd5c64b6ca08e9b2853cc22 100644 +index 279e1cfd24f29d3ac55e74759d8b542a7520de3d..5b81ed7a9f978b59b1b287126c9161aa6446a28d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,6 +22,7 @@ dependencies { @@ -17,7 +17,7 @@ index e6b6d1f26fd673f35f66a09a64c83810e092e757..1bccc21fa2130e577bd5c64b6ca08e9b runtimeOnly(common.maven.provider) diff --git a/src/main/java/io/papermc/paper/configuration/Configurations.java b/src/main/java/io/papermc/paper/configuration/Configurations.java -index 44dda308913d8d25e53d8d0fc7e50c0c678b76d0..5500196e8ca85f9e4542d2ffd02a6f8f12a09083 100644 +index f5d725feb6d32f947eed82073c5594e205f31afe..71be8c8e5bb887a68e9ae5ab822313d7766ad6ca 100644 --- a/src/main/java/io/papermc/paper/configuration/Configurations.java +++ b/src/main/java/io/papermc/paper/configuration/Configurations.java @@ -39,28 +39,95 @@ public abstract class Configurations { @@ -517,10 +517,10 @@ index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15e + } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index b797f719acb2258bee1cc93394561f14a9df5296..aa02d9390a90e235476a25db31c915668ebc0ec9 100644 +index 6d549448e67a110a42dde6f8eeaab1f0033f3462..065308f8cca471dee8360857bd627402849976dc 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -316,6 +316,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); -@@ -1743,17 +1744,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop tickables = Lists.newArrayList(); @@ -120,7 +120,7 @@ index 2213f09a99ea832f59ba802d411f11abfdc8141b..ecf2f3fb8bd62fca7552da8704752db9 private ServerConnectionListener connection; public final ChunkProgressListenerFactory progressListenerFactory; @Nullable -@@ -2596,10 +2596,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { -@@ -2869,12 +2872,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop resultConsumer, Consumer dumpConsumer) { @@ -156,7 +156,7 @@ index 2213f09a99ea832f59ba802d411f11abfdc8141b..ecf2f3fb8bd62fca7552da8704752db9 } public void stopRecordingMetrics() { -@@ -2889,6 +2892,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop loadStatusIcon() {