From 6d70d2180fe263147292d9375deef321dc40eb05 Mon Sep 17 00:00:00 2001 From: AlphaKR93 Date: Sun, 26 May 2024 23:29:57 +0900 Subject: [PATCH] Fix build --- gradle.properties | 1 + patches/server/0004-Fork-friendly-Rebranding.patch | 8 ++++---- patches/server/0009-Warn-on-startup.patch | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gradle.properties b/gradle.properties index 06c98b9a6..97e670557 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,6 +8,7 @@ paper.runMemoryGb = 8 paper.runDisableWatchdog = true group = org.plazmamc.plazma +brandKey = plazmamc:plazma brandName = Plazma providerName = PlazmaMC providerRepo = PlazmaMC/PlazmaBukkit diff --git a/patches/server/0004-Fork-friendly-Rebranding.patch b/patches/server/0004-Fork-friendly-Rebranding.patch index 1f4bae6b7..c8b2bec6c 100644 --- a/patches/server/0004-Fork-friendly-Rebranding.patch +++ b/patches/server/0004-Fork-friendly-Rebranding.patch @@ -126,7 +126,7 @@ index 3cb56595822799926a8141e60a42f5d1edfc6de5..70d6e514870b5cdf529eb067137a5c15 .option(LineReader.Option.COMPLETE_IN_WORD, true); diff --git a/src/main/java/io/papermc/paper/ServerBrandConstants.java b/src/main/java/io/papermc/paper/ServerBrandConstants.java new file mode 100644 -index 0000000000000000000000000000000000000000..c60e1ce73b80125efaf8bff273d3bffa90a20b39 +index 0000000000000000000000000000000000000000..b085cb9b49f2b6b1ad72448959d57a5a7b1f1f21 --- /dev/null +++ b/src/main/java/io/papermc/paper/ServerBrandConstants.java @@ -0,0 +1,33 @@ @@ -137,7 +137,7 @@ index 0000000000000000000000000000000000000000..c60e1ce73b80125efaf8bff273d3bffa +public enum ServerBrandConstants {; + + // Basic brand informations -+ private static final String BRAND_NAME = "Plazma"; ++ protected static final String BRAND_NAME = "Plazma"; + public static final String RESOURCE_PATH = "META-INF/maven/org.plazmamc.plazma/plazma-api/pom.properties"; + + @Nullable @@ -217,7 +217,7 @@ index 96142deb42700f888ea08689ab62c27ef2b881fd..62b602450a53cfebf08f839b505d0e96 } } diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java -index c366d84518979e842a6f10f969a5951539ecac93..4d4a565435c1c73d0693be89b4a6624d1a8515eb 100644 +index c366d84518979e842a6f10f969a5951539ecac93..4a885298859a0dff663d12075c82b42b48cce2ef 100644 --- a/src/main/java/net/minecraft/CrashReport.java +++ b/src/main/java/net/minecraft/CrashReport.java @@ -37,7 +37,7 @@ public class CrashReport { @@ -234,7 +234,7 @@ index c366d84518979e842a6f10f969a5951539ecac93..4d4a565435c1c73d0693be89b4a6624d // 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 %s INSTEAD!".formatted(io.papermc.paper.ServerBuildInfoImpl.BRAND_UCASE)); // Plazma - Fork-friendly Rebranding ++ stringbuilder.append("// DO NOT REPORT THIS TO PAPER OR PURPUR! REPORT TO %s INSTEAD!".formatted(io.papermc.paper.ServerBrandConstants.BRAND_UCASE)); // Plazma - Fork-friendly Rebranding // Purpur end stringbuilder.append("// "); stringbuilder.append(CrashReport.getErrorComment()); diff --git a/patches/server/0009-Warn-on-startup.patch b/patches/server/0009-Warn-on-startup.patch index 527d2b67a..754a0b892 100644 --- a/patches/server/0009-Warn-on-startup.patch +++ b/patches/server/0009-Warn-on-startup.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Warn on startup diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 4911a6d25d12eb9d2b263aeb9b7f521ff828397a..ab19474f251e1cca9455559db15023a6254c3524 100644 +index 4911a6d25d12eb9d2b263aeb9b7f521ff828397a..57deffa2f3d2f0074512440e668c71afb38510d4 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java @@ -112,6 +112,18 @@ public class Main { @@ -15,9 +15,9 @@ index 4911a6d25d12eb9d2b263aeb9b7f521ff828397a..ab19474f251e1cca9455559db15023a6 + // Plazma start - Warn on startup + if (!org.plazmamc.plazma.Options.NO_WARN) { + LOGGER.warn("Warning! " + io.papermc.paper.ServerBuildInfo.buildInfo().brandName() + " may cause unexpected problems, so be sure to test it thoroughly before using it on a public server."); -+ if (io.papermc.paper.ServerBuildInfo.buildInfo().asString().contains("DEV")) { ++ if (io.papermc.paper.ServerBuildInfo.buildInfo().asString(io.papermc.paper.ServerBuildInfo.StringRepresentation.VERSION_FULL).contains("DEV")) { + LOGGER.error("*********************** CAUTION ***********************"); -+ LOGGER.error("This version is a development version of " + io.papermc.paper.ServerBuildInfo.buildInfo().brandName() + "."); ++ LOGGER.error("This version is a development version of {}.", io.papermc.paper.ServerBuildInfo.buildInfo().brandName()); + LOGGER.error("Nobody knows what kind of problem you're going to have, and there's always the possibility of unexpected problems."); + LOGGER.error("Never use this version on a public server, and after you've tested it enough before using it!"); + LOGGER.error("*******************************************************");