Files
Shiroha/shiroha-server/paper-patches/features/0001-Rebrand-to-Shiroha.patch
T

116 lines
8.4 KiB
Diff
Raw Normal View History

2026-07-09 00:03:09 +08:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Wed, 8 Jul 2026 18:15:19 +0800
2026-07-14 11:32:51 +08:00
Subject: [PATCH] Rebrand to Shiroha
2026-07-09 00:03:09 +08:00
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
2026-07-14 15:09:17 +08:00
index 08745a35b1ce8cc56d970472088de3cd17b9e43a..02bf179039196aeeb94c7392c28c214c9a19e641 100644
2026-07-09 00:03:09 +08:00
--- 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 {
boolean logFailedRequests = config.getBoolean("logFailedRequests", false);
// Only start Metrics, if it's enabled in the config
if (config.getBoolean("enabled", true)) {
- Metrics metrics = new Metrics("Folia", serverUUID, logFailedRequests, Bukkit.getLogger()); // Folia - we have our own bstats page
2026-07-14 13:29:52 +08:00
+ Metrics metrics = new Metrics("Shiroha", serverUUID, logFailedRequests, Bukkit.getLogger()); // Folia - we have our own bstats page // Shiroha - Rebrand to Shiroha
2026-07-09 00:03:09 +08:00
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
String minecraftVersion = Bukkit.getVersion();
@@ -607,11 +607,11 @@ public class Metrics {
final String implVersion = org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion();
if (implVersion != null) {
final String buildOrHash = implVersion.substring(implVersion.lastIndexOf('-') + 1);
- paperVersion = "git-Folia-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Folia - we have our own bstats page
2026-07-14 13:29:52 +08:00
+ paperVersion = "git-Shiroha-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Folia - we have our own bstats page // Shiroha - Rebrand to Shiroha
2026-07-09 00:03:09 +08:00
} else {
paperVersion = "unknown";
}
- metrics.addCustomChart(new Metrics.SimplePie("folia_version", () -> paperVersion)); // Folia - we have our own bstats page
2026-07-14 13:29:52 +08:00
+ metrics.addCustomChart(new Metrics.SimplePie("shiroha_version", () -> paperVersion)); // Folia - we have our own bstats page // Shiroha - Rebrand to Shiroha
2026-07-09 00:03:09 +08:00
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
Map<String, Map<String, Integer>> map = new HashMap<>();
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
2026-07-14 18:56:51 +08:00
index 30815c8970b1f1c88a3c7bb5fd36efd915f1687d..5ab805cb39d45fe9a2607dadb79ee520199fab8f 100644
2026-07-09 00:03:09 +08:00
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
@@ -40,8 +40,8 @@ public class PaperVersionFetcher implements VersionFetcher {
private static final ComponentLogger COMPONENT_LOGGER = ComponentLogger.logger(LogManager.getRootLogger().getName());
private static final int DISTANCE_ERROR = -1;
private static final int DISTANCE_UNKNOWN = -2;
- private static final String DOWNLOAD_PAGE = "https://papermc.io/downloads/folia"; // Folia
- private static final String REPOSITORY = "PaperMC/Folia"; // Folia
2026-07-14 18:56:51 +08:00
+ private static final String DOWNLOAD_PAGE = "https://codeberg.org/NanaChiyo0721/Shiroha"; // Folia // Shiroha - Rebrand to Shiroha
2026-07-14 13:29:52 +08:00
+ private static final String REPOSITORY = "Nanachiyo0721/Shiroha"; // Folia // Shiroha - Rebrand to Shiroha
2026-07-09 00:03:09 +08:00
private static final ServerBuildInfo BUILD_INFO = ServerBuildInfo.buildInfo();
private static final String USER_AGENT = BUILD_INFO.brandName() + "/" + BUILD_INFO.asString(VERSION_SIMPLE) + " (https://papermc.io)";
private static final Gson GSON = new Gson();
@@ -72,7 +72,7 @@ public class PaperVersionFetcher implements VersionFetcher {
COMPONENT_LOGGER.warn(text("*** You are running a development version without access to version information ***"));
} else {
final Optional<MinecraftVersionFetcher> apiResult = fetchMinecraftVersionList();
- if (buildNumber.isPresent()) {
2026-07-14 11:32:51 +08:00
+ if (buildNumber.isPresent() && false) { // Shiroha - Rebrand to Shiroha - we do not have a version manager api currently, disable it
2026-07-09 00:03:09 +08:00
distance = fetchDistanceFromSiteApi(buildNumber.getAsInt());
} else {
final Optional<String> gitBranch = BUILD_INFO.gitBranch();
@@ -111,7 +111,7 @@ public class PaperVersionFetcher implements VersionFetcher {
int distance = DISTANCE_ERROR;
final OptionalInt buildNumber = PaperVersionFetcher.BUILD_INFO.buildNumber();
- if (buildNumber.isPresent()) {
2026-07-14 11:32:51 +08:00
+ if (buildNumber.isPresent() && false) { // Shiroha - Rebrand to Shiroha - we do not have a version manager api currently, disable it
2026-07-09 00:03:09 +08:00
distance = fetchDistanceFromSiteApi(buildNumber.getAsInt());
} else {
final Optional<String> gitBranch = PaperVersionFetcher.BUILD_INFO.gitBranch();
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
2026-07-14 15:09:17 +08:00
index 10a0be7a4db1a51579d113d279af7a9effe7f438..3d53b8f7a49c80d37b02fe72d11779b851700705 100644
2026-07-09 00:03:09 +08:00
--- a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
+++ b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
@@ -31,6 +31,7 @@ public record ServerBuildInfoImpl(
private static final String ATTRIBUTE_GIT_COMMIT = "Git-Commit";
private static final String BRAND_PAPER_NAME = "Paper";
2026-07-14 15:09:17 +08:00
+ private static final String BRAND_SHIROHA_NAME = "Shiroha"; // Shiroha - Rebrand to Shiroha
2026-07-09 00:03:09 +08:00
private static final String BUILD_DEV = "DEV";
@@ -42,9 +43,9 @@ public record ServerBuildInfoImpl(
this(
getManifestAttribute(manifest, ATTRIBUTE_BRAND_ID)
.map(Key::key)
- .orElse(Key.key("papermc", "folia")), // Folia
2026-07-14 15:09:17 +08:00
+ .orElse(BRAND_SHIROHA_ID), // Folia // Shiroha - Rebrand to Shiroha
2026-07-09 00:03:09 +08:00
getManifestAttribute(manifest, ATTRIBUTE_BRAND_NAME)
- .orElse("Folia"), // Folia
2026-07-14 15:09:17 +08:00
+ .orElse(BRAND_SHIROHA_NAME), // Folia // Shiroha - Rebrand to Shiroha
2026-07-09 00:03:09 +08:00
SharedConstants.getCurrentVersion().id(),
SharedConstants.getCurrentVersion().name(),
getManifestAttribute(manifest, ATTRIBUTE_BUILD_NUMBER)
@@ -61,7 +62,7 @@ public record ServerBuildInfoImpl(
@Override
public boolean isBrandCompatible(final @NotNull Key brandId) {
- return brandId.equals(this.brandId);
2026-07-14 11:32:51 +08:00
+ return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID) || brandId.equals(BRAND_FOLIA_ID); // Shiroha - Rebrand to Shiroha
2026-07-09 00:03:09 +08:00
}
@Override
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
2026-07-14 15:09:17 +08:00
index 5607f4cc8ca2f620461eb5e97d01d9db0d6b2303..6f0a2d3bc3d966079978db8dfb19236eeb89d579 100644
2026-07-09 00:03:09 +08:00
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -80,9 +80,9 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre
logger.log(Level.SEVERE, "\t *Especially* if it looks like HTTP or MySQL operations are occurring");
logger.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");
logger.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");
- logger.log(Level.SEVERE, "If you are unsure or still think this is a Paper bug, please report this to https://github.com/PaperMC/Paper/issues");
2026-07-14 13:29:52 +08:00
+ logger.log(Level.SEVERE, "If you are unsure or still think this is a Shiroha bug, please report this to https://github.com/Nanachiyo0721/Shiroha/issues"); // Shiroha - Rebrand to Shiroha
2026-07-09 00:03:09 +08:00
logger.log(Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports");
- logger.log(Level.SEVERE, "Paper version: " + Bukkit.getServer().getVersion());
2026-07-14 13:29:52 +08:00
+ logger.log(Level.SEVERE, "Shiroha version: " + Bukkit.getServer().getVersion()); // Shiroha - Rebrand to Shiroha
2026-07-09 00:03:09 +08:00
if (net.minecraft.world.level.Level.lastPhysicsProblem != null) {
logger.log(Level.SEVERE, "------------------------------");