From b80c8b15d64a774fb7e9ffe6518074f92b4e7acc Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Thu, 4 Jul 2024 19:55:01 +0800 Subject: [PATCH] Fix Nova compatibility --- .../server/0095-Fix-Nova-compatibility.patch | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 patches/server/0095-Fix-Nova-compatibility.patch diff --git a/patches/server/0095-Fix-Nova-compatibility.patch b/patches/server/0095-Fix-Nova-compatibility.patch new file mode 100644 index 00000000..44f268b0 --- /dev/null +++ b/patches/server/0095-Fix-Nova-compatibility.patch @@ -0,0 +1,54 @@ +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 + +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; ++}