9
0
mirror of https://github.com/Xiao-MoMi/Custom-Nameplates.git synced 2025-12-19 15:09:23 +00:00
This commit is contained in:
XiaoMoMi
2024-08-31 02:56:40 +08:00
parent f597e584ee
commit 425a08a57a
4 changed files with 14 additions and 6 deletions

View File

@@ -7,7 +7,7 @@ plugins {
allprojects {
version = "2.4.8"
version = "2.4.8.1"
apply<JavaPlugin>()
apply(plugin = "java")

View File

@@ -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() {

View File

@@ -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() {

View File

@@ -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
cache-size: 256
# Decides whether CustomNameplates should catch actionbar sent by other plugins
catch-other-plugin-actionbar: true