185 lines
13 KiB
Diff
185 lines
13 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: nostalgic853 <yuu8583@proton.me>
|
|
Date: Thu, 20 Oct 2022 10:07:45 +0800
|
|
Subject: [PATCH] Rebrand
|
|
|
|
|
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
|
index 2ee34f92e8a89b90448bbf710fdc0d5d6350e919..2e7df664f5a89d28cb07371fa97de5da54269f84 100644
|
|
--- a/build.gradle.kts
|
|
+++ b/build.gradle.kts
|
|
@@ -9,7 +9,7 @@ plugins {
|
|
}
|
|
|
|
dependencies {
|
|
- implementation(project(":purpur-api")) // Purpur
|
|
+ implementation(project(":keyi-api")) // Purpur // KeYi
|
|
// Pufferfish start
|
|
implementation("io.papermc.paper:paper-mojangapi:1.19.2-R0.1-SNAPSHOT") {
|
|
exclude("io.papermc.paper", "paper-api")
|
|
@@ -80,13 +80,13 @@ tasks.jar {
|
|
manifest {
|
|
val git = Git(rootProject.layout.projectDirectory.path)
|
|
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
|
|
- val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
|
|
+ val implementationVersion = System.getenv("BUILD_NUMBER") ?: gitHash // KeYi
|
|
val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper
|
|
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",// Purpur
|
|
+ "Implementation-Version" to "git-KeYi-$implementationVersion",// Purpur // KeYi
|
|
"Implementation-Vendor" to date, // Paper
|
|
"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 acd95cf1dc7f009b63e44e4404e1736283fd458e..3436a377f9c11d8f2a39af65c3370861fedb1b87 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 {
|
|
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("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Purpur
|
|
+ Metrics metrics = new Metrics("KeYi", serverUUID, logFailedRequests, Bukkit.getLogger()); // Purpur // KeYi
|
|
|
|
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
|
|
String minecraftVersion = Bukkit.getVersion();
|
|
@@ -603,7 +603,7 @@ public class Metrics {
|
|
|
|
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", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Purpur
|
|
+ metrics.addCustomChart(new Metrics.SimplePie("keyi_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Purpur // KeYi
|
|
|
|
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
|
|
index fba5dbdb7bcbb55400ef18342c9b54612972a718..bf7283af7537385ce429aedc394d97e6534ab621 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
|
@@ -20,7 +20,7 @@ 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
|
|
- private static final String DOWNLOAD_PAGE = "https://purpurmc.org/downloads";
|
|
+ private static final String DOWNLOAD_PAGE = "https://github.com/KeYiMC/KeYi/releases"; // KeYi
|
|
private static int distance = -2; public int distance() { return distance; }
|
|
// Purpur end
|
|
private static @Nullable String mcVer;
|
|
@@ -33,8 +33,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-KeYi-".length()).split("[-\\s]"); // Purpur // KeYi
|
|
+ final Component updateMessage = getUpdateStatusMessage("KeYiMC/KeYi", "master", parts[0]); // Purpur // KeYi
|
|
final Component history = 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 KeYi!"); // Purpur // KeYi
|
|
org.bukkit.Bukkit.getLogger().warning("Pattern: " + VER_PATTERN.toString());
|
|
org.bukkit.Bukkit.getLogger().warning("Version: " + org.bukkit.Bukkit.getBukkitVersion());
|
|
}
|
|
@@ -58,6 +58,8 @@ public class PaperVersionFetcher implements VersionFetcher {
|
|
|
|
private static Component getUpdateStatusMessage(@Nonnull String repo, @Nonnull String branch, @Nonnull String versionInfo) {
|
|
//int distance; // Purpur - use field
|
|
+ // KeYi start - we don't have jenkins
|
|
+ /*
|
|
try {
|
|
int jenkinsBuild = Integer.parseInt(versionInfo);
|
|
distance = fetchDistanceFromSiteApi(jenkinsBuild, getMinecraftVersion());
|
|
@@ -65,6 +67,12 @@ public class PaperVersionFetcher implements VersionFetcher {
|
|
versionInfo = versionInfo.replace("\"", "");
|
|
distance = fetchDistanceFromGitHub(repo, branch, versionInfo);
|
|
}
|
|
+ */
|
|
+
|
|
+ versionInfo = versionInfo.replace("\"", "");
|
|
+ distance = fetchDistanceFromGitHub(repo, branch, versionInfo);
|
|
+
|
|
+ // KeYi end
|
|
|
|
switch (distance) {
|
|
case -1:
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
|
index fb87620c742ff7912f5e8ccd2a7930dd605576d9..d779212cbb719a1d923a24823135c5d3543ae65c 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
|
@@ -11,7 +11,7 @@ public final class Versioning {
|
|
public static String getBukkitVersion() {
|
|
String result = "Unknown-Version";
|
|
|
|
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Purpur
|
|
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/cc.keyimc.keyi/keyi-api/pom.properties"); // Purpur // KeYi
|
|
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 5d71e3040df116a94df7efa83e61dc1766cc4a93..75f73042a72c6dde630ed106668fe2c60a8243f9 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
|
@@ -244,7 +244,7 @@ public class PurpurConfig {
|
|
if (!TimingsManager.hiddenConfigs.contains("settings.seed")) TimingsManager.hiddenConfigs.add("settings.seed");
|
|
}
|
|
|
|
- public static String serverModName = "Purpur";
|
|
+ public static String serverModName = "KeYi"; // KeYi
|
|
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 a810bfd3b8d6bd4d8f2ef8797e4281ae4fe8a67f..e5a63fc8d7b82408b892230c972b8ea0c59fa8a7 100644
|
|
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
|
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
|
@@ -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 KeYi bug." ); // Paper // Purpur // KeYi
|
|
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 KeYi bug, please report this to https://github.com/PurpurMC/Purpur/issues" ); // Purpur // KeYi
|
|
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, "KeYi version: " + Bukkit.getServer().getVersion() ); // Purpur // KeYi
|
|
//
|
|
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
|
|
{
|
|
@@ -185,12 +185,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 KEYI - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur // KeYi
|
|
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 KeYi!):" ); // Paper // Purpur // KeYi
|
|
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper // Paper - rewrite chunk system
|
|
this.dumpTickingInfo(); // Paper - log detailed tick information
|
|
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
|
|
@@ -206,7 +206,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 KEYI - THIS IS NOT A BUG OR A CRASH ---"); // Purpur // KeYi
|
|
}
|
|
|
|
log.log( Level.SEVERE, "------------------------------" );
|