Skip to content

Commit

Permalink
Fix Nova compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Jul 4, 2024
1 parent 504935f commit b80c8b1
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions patches/server/0095-Fix-Nova-compatibility.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dreeam <[email protected]>
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;
+}

0 comments on commit b80c8b1

Please sign in to comment.