From b97afb85a1797e7229794d20ab86d0a09a64a7ed Mon Sep 17 00:00:00 2001 From: GJ Date: Mon, 29 Apr 2013 00:29:38 -0400 Subject: [PATCH] Only check names if CombatTag is enabled. --- src/main/java/com/gmail/nossr50/mcMMO.java | 5 ++++- src/main/java/com/gmail/nossr50/util/Misc.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 7d2f3b4ac..9bc8305dd 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -82,8 +82,9 @@ public class mcMMO extends JavaPlugin { // Update Check private boolean updateAvailable; - // Spout Check + // Plugin Checks public static boolean spoutEnabled; + public static boolean combatTagEnabled; // XP Event Check private boolean xpEventEnabled; @@ -113,6 +114,8 @@ public class mcMMO extends JavaPlugin { setupSpout(); loadConfigFiles(); + combatTagEnabled = getServer().getPluginManager().isPluginEnabled("CombatTag"); + databaseManager = new DatabaseManager(this, Config.getInstance().getUseMySQL()); registerEvents(); diff --git a/src/main/java/com/gmail/nossr50/util/Misc.java b/src/main/java/com/gmail/nossr50/util/Misc.java index 390a4bf8d..e3c26a1c4 100644 --- a/src/main/java/com/gmail/nossr50/util/Misc.java +++ b/src/main/java/com/gmail/nossr50/util/Misc.java @@ -44,7 +44,7 @@ public final class Misc { } public static boolean isNPCEntity(Entity entity) { - return (entity == null || entity.hasMetadata("NPC") || (entity instanceof HumanEntity && ((HumanEntity) entity).getName().contains("PvpLogger"))); + return (entity == null || entity.hasMetadata("NPC") || (mcMMO.combatTagEnabled && entity instanceof HumanEntity && ((HumanEntity) entity).getName().contains("PvpLogger"))); } /**