diff --git a/build.gradle.kts b/build.gradle.kts index 1345612..a515d6a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { allprojects { - version = "2.4.8" + version = "2.4.8.1" apply() apply(plugin = "java") diff --git a/paper/src/main/java/net/momirealms/customnameplates/paper/mechanic/actionbar/ActionBarManagerImpl.java b/paper/src/main/java/net/momirealms/customnameplates/paper/mechanic/actionbar/ActionBarManagerImpl.java index bb8abec..b6608dd 100644 --- a/paper/src/main/java/net/momirealms/customnameplates/paper/mechanic/actionbar/ActionBarManagerImpl.java +++ b/paper/src/main/java/net/momirealms/customnameplates/paper/mechanic/actionbar/ActionBarManagerImpl.java @@ -85,9 +85,11 @@ public class ActionBarManagerImpl implements ActionBarManager, Listener { } Bukkit.getPluginManager().registerEvents(this, plugin); - if (actionBarListener != null) ProtocolLibrary.getProtocolManager().addPacketListener(actionBarListener); - if (systemChatListener != null) ProtocolLibrary.getProtocolManager().addPacketListener(systemChatListener); - if (chatMessageListener != null) ProtocolLibrary.getProtocolManager().addPacketListener(chatMessageListener); + if (CNConfig.catchOtherActionBar) { + if (actionBarListener != null) ProtocolLibrary.getProtocolManager().addPacketListener(actionBarListener); + if (systemChatListener != null) ProtocolLibrary.getProtocolManager().addPacketListener(systemChatListener); + if (chatMessageListener != null) ProtocolLibrary.getProtocolManager().addPacketListener(chatMessageListener); + } } public void unload() { diff --git a/paper/src/main/java/net/momirealms/customnameplates/paper/setting/CNConfig.java b/paper/src/main/java/net/momirealms/customnameplates/paper/setting/CNConfig.java index e7e1f14..4217787 100644 --- a/paper/src/main/java/net/momirealms/customnameplates/paper/setting/CNConfig.java +++ b/paper/src/main/java/net/momirealms/customnameplates/paper/setting/CNConfig.java @@ -88,6 +88,7 @@ public class CNConfig { public static boolean carbonChatChannel; public static boolean advancedChatChannel; public static boolean hasLibsDisguise; + public static boolean catchOtherActionBar; public static void load() { try { @@ -182,6 +183,8 @@ public class CNConfig { createRealTeam = config.getBoolean("other-settings.create-real-teams", false); hasLibsDisguise = Bukkit.getPluginManager().getPlugin("LibsDisguises") != null; + + catchOtherActionBar = config.getBoolean("other-settings.catch-other-plugin-actionbar", true); } public static boolean isOtherTeamPluginHooked() { diff --git a/paper/src/main/resources/config.yml b/paper/src/main/resources/config.yml index d6b0873..9e39423 100644 --- a/paper/src/main/resources/config.yml +++ b/paper/src/main/resources/config.yml @@ -1,5 +1,5 @@ # Do not change -config-version: '27' +config-version: '28' # Debug mode debug: false @@ -112,4 +112,7 @@ other-settings: # With cache system, you can save much CPU resource when the same message is displayed to many players. # The more people on your server, the higher the efficiency of the caching system's operation. # In most cases you don't have to edit this value. You can increase this value appropriately, especially when there are many players on your server. - cache-size: 256 \ No newline at end of file + cache-size: 256 + + # Decides whether CustomNameplates should catch actionbar sent by other plugins + catch-other-plugin-actionbar: true \ No newline at end of file