254 lines
17 KiB
Diff
254 lines
17 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
|
|
Date: Fri, 10 Feb 2023 02:58:46 +0200
|
|
Subject: [PATCH] Rebranding
|
|
|
|
|
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
|
index 215366d7cc3720805d2dfde0662372ecede8383c..24f16ac70f993b9645ff01473633f542e57b0fc0 100644
|
|
--- a/build.gradle.kts
|
|
+++ b/build.gradle.kts
|
|
@@ -8,7 +8,7 @@ plugins {
|
|
|
|
dependencies {
|
|
// Folia start
|
|
- implementation(project(":folia-api"))
|
|
+ implementation(project(":kaiiju-api")) // Kaiiju
|
|
implementation("io.papermc.paper:paper-mojangapi:1.19.3-R0.1-SNAPSHOT") {
|
|
exclude("io.papermc.paper", "paper-api")
|
|
}
|
|
@@ -68,7 +68,7 @@ tasks.jar {
|
|
attributes(
|
|
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
|
"Implementation-Title" to "CraftBukkit",
|
|
- "Implementation-Version" to "git-Folia-$implementationVersion", // Folia
|
|
+ "Implementation-Version" to "git-Kaiiju-$implementationVersion", // Folia // Kaiiju
|
|
"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 58dc84b7b3b04c2d0b00fc5fac5303d3378b3467..a128b1fabd4aadfe26a8375903c0451d7a65983a 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("Folia", serverUUID, logFailedRequests, Bukkit.getLogger()); // Folia - we have our own bstats page
|
|
+ Metrics metrics = new Metrics("Kaiiju", serverUUID, logFailedRequests, Bukkit.getLogger()); // Folia - we have our own bstats page // Kaiiju
|
|
|
|
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
|
|
String minecraftVersion = Bukkit.getVersion();
|
|
@@ -612,6 +612,7 @@ public class Metrics {
|
|
paperVersion = "unknown";
|
|
}
|
|
metrics.addCustomChart(new Metrics.SimplePie("folia_version", () -> paperVersion)); // Folia - we have our own bstats page
|
|
+ metrics.addCustomChart(new Metrics.SimplePie("kaiiju_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Kaiiju
|
|
|
|
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 e2f704c115fd6e00960bb56bb0779f1100c89c17..95bc514df2022dde265b84490d3d0db002685024 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
|
@@ -20,9 +20,11 @@ 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
|
|
private static final String GITHUB_BRANCH_NAME = "master";
|
|
- private static final String DOWNLOAD_PAGE = "https://papermc.io/downloads/paper";
|
|
+ // Kaiiju start
|
|
+ private static final String DOWNLOAD_PAGE = "https://github.com/KaiijuMC/Kaiiju/releases";
|
|
+ private static int distance = -2; public int distance() { return distance; }
|
|
+ // Kaiiju end
|
|
private static @Nullable String mcVer;
|
|
-
|
|
@Override
|
|
public long getCacheTime() {
|
|
return 720000;
|
|
@@ -31,8 +33,8 @@ public class PaperVersionFetcher implements VersionFetcher {
|
|
@Nonnull
|
|
@Override
|
|
public Component getVersionMessage(@Nonnull String serverVersion) {
|
|
- String[] parts = serverVersion.substring("git-Folia-".length()).split("[-\\s]"); // Folia
|
|
- final Component updateMessage = getUpdateStatusMessage("PaperMC/Folia", GITHUB_BRANCH_NAME, parts[0]); // Folia
|
|
+ String[] parts = serverVersion.substring("git-Kaiiju-".length()).split("[-\\s]"); // Folia // Kaiiju
|
|
+ final Component updateMessage = getUpdateStatusMessage("KaiijuMC/Kaiiju", "ver/" + getMinecraftVersion(), parts[0]); // Folia // Kaiiju
|
|
final Component history = getHistory();
|
|
|
|
return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage;
|
|
@@ -45,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 PaperMC!");
|
|
+ org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to KaiijuMC!"); // Kaiiju
|
|
org.bukkit.Bukkit.getLogger().warning("Pattern: " + VER_PATTERN.toString());
|
|
org.bukkit.Bukkit.getLogger().warning("Version: " + org.bukkit.Bukkit.getBukkitVersion());
|
|
}
|
|
@@ -56,6 +58,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
|
|
|
private static Component getUpdateStatusMessage(@Nonnull String repo, @Nonnull String branch, @Nonnull String versionInfo) {
|
|
int distance;
|
|
+ /* // Kaiiju - disable jenkins/api checking
|
|
try {
|
|
int jenkinsBuild = Integer.parseInt(versionInfo);
|
|
distance = fetchDistanceFromSiteApi(jenkinsBuild, getMinecraftVersion());
|
|
@@ -63,6 +66,11 @@ public class PaperVersionFetcher implements VersionFetcher {
|
|
versionInfo = versionInfo.replace("\"", "");
|
|
distance = fetchDistanceFromGitHub(repo, branch, versionInfo);
|
|
}
|
|
+ // Kaiiju start - disable jenkins/api checking
|
|
+ */
|
|
+ versionInfo = versionInfo.replace("\"", "");
|
|
+ distance = fetchDistanceFromGitHub(repo, branch, versionInfo);
|
|
+ // Kaiiju end
|
|
|
|
switch (distance) {
|
|
case -1:
|
|
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
|
index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..1c7b5d91e914efbcfb50c6137c7760787e38ad94 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 {
|
|
@Override
|
|
protected LineReader buildReader(LineReaderBuilder builder) {
|
|
builder
|
|
- .appName("Paper")
|
|
+ .appName("Kaiiju") // Kaiiju
|
|
.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/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java
|
|
index abe37c7c3c6f5ab73afd738ec78f06d7e4d2ed96..52fc6bb99f6024273c7438d01314b576da66bd1a 100644
|
|
--- a/src/main/java/net/minecraft/CrashReport.java
|
|
+++ b/src/main/java/net/minecraft/CrashReport.java
|
|
@@ -125,7 +125,7 @@ public class CrashReport {
|
|
stringbuilder.append("---- Minecraft Crash Report ----\n");
|
|
stringbuilder.append("// ");
|
|
stringbuilder.append(CrashReport.getErrorComment());
|
|
- stringbuilder.append("\n\n");
|
|
+ stringbuilder.append("// DO NOT REPORT THIS TO PAPER/FOLIA! REPORT TO KAIIJU INSTEAD!"); // Kaiiju
|
|
stringbuilder.append("Time: ");
|
|
stringbuilder.append(CrashReport.DATE_TIME_FORMATTER.format(ZonedDateTime.now()));
|
|
stringbuilder.append("\n");
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
index 11ff1bc559316da426070867f045720ebd8c1962..cc1a7c4d38874ec218f7151685ae6cc00295c2e4 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -995,7 +995,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
shutdownThread = Thread.currentThread();
|
|
org.spigotmc.WatchdogThread.doStop(); // Paper
|
|
if (false && !isSameThread()) { // Folia - region threading
|
|
- MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PAPER)");
|
|
+ MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO KAIIJU)"); // Kaiiju
|
|
while (this.getRunningThread().isAlive()) {
|
|
this.getRunningThread().stop();
|
|
try {
|
|
@@ -1812,7 +1812,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
@DontObfuscate
|
|
public String getServerModName() {
|
|
- return "Folia"; // Folia - Folia > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
|
+ return "Kaiiju"; // Kaiiju - Kaiiju > // Folia - Folia > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
|
}
|
|
|
|
public SystemReport fillSystemReport(SystemReport details) {
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
index 20af7484bf570d28cd9723fdbb1ec07657117367..753594551faa1bff4317386c3df927f486900dab 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
@@ -261,7 +261,7 @@ import javax.annotation.Nullable; // Paper
|
|
import javax.annotation.Nonnull; // Paper
|
|
|
|
public final class CraftServer implements Server {
|
|
- private final String serverName = "Folia"; // Folia // Paper
|
|
+ private final String serverName = "Kaiiju"; // Kaiiju // Folia // Paper
|
|
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/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
index 564c72d6351721505dbffaf5af732db2dd3210ac..957ae18874710ad0e10f4210fc819fe555437c01 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
@@ -886,7 +886,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|
return EntityCategory.WATER;
|
|
}
|
|
|
|
- throw new UnsupportedOperationException("Unsupported monster type: " + type + ". This is a bug, report this to Spigot.");
|
|
+ throw new UnsupportedOperationException("Unsupported monster type: " + type + ". This is a bug, report this to Kaiiju."); // Kaiiju
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
index eb84a8dd97f92de4a7dd3826d9e124a442cba565..e24d653fafcd88e01786b77539c506bcf3751c2c 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
@@ -501,7 +501,7 @@ public class CraftScheduler implements BukkitScheduler {
|
|
this.parsePending();
|
|
} 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 Paper"); // Paper
|
|
+ task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Kaiiju"); // Paper // Kaiiju
|
|
// 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 e9b6ca3aa25e140467ae866d572483050ea3fa0e..5df2b0fceebaaa863f4f143c8f29e808b7f0c49b 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/dev.folia/folia-api/pom.properties"); // Folia
|
|
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/dev.kaiijumc.kaiiju/kaiiju-api/pom.properties"); // Folia // Kaiiju
|
|
Properties properties = new Properties();
|
|
|
|
if (stream != null) {
|
|
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
|
index 98fba0288be9ed2cb18ffba5cf81148157dd4fcf..9c1477cfa1a8074c4b3b8a365bb03c44eaa62972 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 Paper bug." ); // Paper
|
|
+ log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Kaiiju bug." ); // Paper // Kaiiju
|
|
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 Paper bug, please report this to https://github.com/PaperMC/Paper/issues" );
|
|
+ log.log( Level.SEVERE, "If you are unsure or still think this is a Kaiiju bug, please report this to https://github.com/KaiijuMC/Kaiiju/issues" ); // Kaiiju
|
|
log.log( Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports" );
|
|
- log.log( Level.SEVERE, "Paper version: " + Bukkit.getServer().getVersion() );
|
|
+ log.log( Level.SEVERE, "Kaiiju version: " + Bukkit.getServer().getVersion() ); // Kaiiju
|
|
//
|
|
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 PAPER - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---");
|
|
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO KAIIJU - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Kaiiju
|
|
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 Paper!):" ); // Paper
|
|
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Kaiiju!):" ); // Paper // Kaiiju
|
|
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 PAPER - THIS IS NOT A BUG OR A CRASH ---");
|
|
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO KAIIJU - THIS IS NOT A BUG OR A CRASH ---"); // Kaiiju
|
|
}
|
|
|
|
log.log( Level.SEVERE, "------------------------------" );
|