9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/leaf-archived-patches/removed/1.20.4/server/0094-Fix-Nova-compatibility.patch
2025-06-29 23:39:55 +08:00

57 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
Date: Thu, 4 Jul 2024 19:47:01 +0800
Subject: [PATCH] Fix Nova compatibility
Removed since 1.20.4, Nova 0.17
By setting server brand to Purpur to be compatible with Nova plugin
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 15c3d62262a589844dbaa8ac357402aa592cd351..5823a3fa71850b38cb00b869e597c2fabc8d4117 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -671,6 +671,12 @@ public final class CraftServer implements Server {
@Override
public String getVersion() {
+ // Leaf start - Fix Nova compatibility
+ if (org.dreeam.leaf.config.modules.misc.FixNovaCompatibility.enabled) {
+ return "git-Purpur-\"0000000\" (MC: " + this.console.getServerVersion() + ")";
+ }
+ // Leaf end - Fix Nova compatibility
+
return this.serverVersion + " (MC: " + this.console.getServerVersion() + ")";
}
diff --git a/src/main/java/org/dreeam/leaf/config/modules/misc/FixNovaCompatibility.java b/src/main/java/org/dreeam/leaf/config/modules/misc/FixNovaCompatibility.java
new file mode 100644
index 0000000000000000000000000000000000000000..fb13c33172b530c080a6028241bb6f5efd91cdaf
--- /dev/null
+++ b/src/main/java/org/dreeam/leaf/config/modules/misc/FixNovaCompatibility.java
@@ -0,0 +1,24 @@
+package org.dreeam.leaf.config.modules.misc;
+
+import org.dreeam.leaf.config.ConfigInfo;
+import org.dreeam.leaf.config.EnumConfigCategory;
+import org.dreeam.leaf.config.IConfigModule;
+
+public class FixNovaCompatibility implements IConfigModule {
+
+ @Override
+ public EnumConfigCategory getCategory() {
+ return EnumConfigCategory.MISC;
+ }
+
+ @Override
+ public String getBaseName() {
+ return "fix_nova_compatibility";
+ }
+
+ @ConfigInfo(baseName = "enabled", comments = """
+ Set the server brand to Purpur if enabled.
+ Don't enable this unless you have to use Nova
+ """)
+ public static boolean enabled = false;
+}