Browse Source

Added a warning message if the server is running NoCheatPlus without CompatNoCheatPlus

TfT_02 11 years ago
parent
commit
100f2c7e56
2 changed files with 11 additions and 1 deletions
  1. 1 0
      Changelog.txt
  2. 10 1
      src/main/java/com/gmail/nossr50/mcMMO.java

+ 1 - 0
Changelog.txt

@@ -30,6 +30,7 @@ Version 1.4.07-dev
  + Added ability to give custom names to items in treasures.yml - use the key "Custom_Name" to set, expects a string.
  + Added ability to give lore to items in treasures.yml - use the key "Lore" to set, expects a list of strings.
  + Added Quartz and Name Tags to the default Excavation treasures
+ + Added a warning message if the server is running NoCheatPlus without CompatNoCheatPlus
  + Killing a custom entity will automatically add it to the custom entity config file with default values.
  = Fixed bug which allowed players to bypass fishing's exploit prevention
  = Fixed bug where FakeEntityDamageByEntityEvent wasn't being fired

+ 10 - 1
src/main/java/com/gmail/nossr50/mcMMO.java

@@ -78,6 +78,8 @@ public class mcMMO extends JavaPlugin {
     /* Plugin Checks */
     private static boolean combatTagEnabled;
     private static boolean healthBarPluginEnabled;
+    private static boolean noCheatPlusPluginEnabled;
+    private static boolean compatNoCheatPlusPluginEnabled;
     private static boolean mcpcEnabled;
 
     // Config Validation Check
@@ -120,9 +122,11 @@ public class mcMMO extends JavaPlugin {
                 return;
             }
 
+            mcpcEnabled = getServer().getName().equals("MCPC+");
             combatTagEnabled = getServer().getPluginManager().getPlugin("CombatTag") != null;
             healthBarPluginEnabled = getServer().getPluginManager().getPlugin("HealthBar") != null;
-            mcpcEnabled = getServer().getName().equals("MCPC+");
+            noCheatPlusPluginEnabled = getServer().getPluginManager().getPlugin("NoCheatPlus") != null;
+            compatNoCheatPlusPluginEnabled = getServer().getPluginManager().getPlugin("CompatNoCheatPlus") != null;
 
             if (mcpcEnabled) {
                 checkModConfigs();
@@ -132,6 +136,11 @@ public class mcMMO extends JavaPlugin {
                 getLogger().info("HealthBar plugin found, mcMMO's healthbars are automatically disabled.");
             }
 
+            if (noCheatPlusPluginEnabled && !compatNoCheatPlusPluginEnabled) {
+                getLogger().warning("NoCheatPlus plugin found, but CompatNoCheatPlus was not found!");
+                getLogger().warning("mcMMO will not work properly alongside NoCheatPlus without CompatNoCheatPlus");
+            }
+
             databaseManager = DatabaseManagerFactory.getDatabaseManager();
 
             registerEvents();