Disable our healthbars when the plugin "HealthBar" is found

Adds #1477
This commit is contained in:
TfT_02 2013-09-22 14:39:20 +02:00
parent 0a9fd4a92e
commit b8c479549c
4 changed files with 13 additions and 2 deletions

View File

@ -52,6 +52,7 @@ Version 1.4.07-dev
! Updated localization files
! Party item share category states are now saved when the server shuts down.
! When using "Super Breaker" or "Giga Driller" abilities extra tool durability is used (again)
! Mob healthbars are automatically disabled when the plugin "HealthBar" is found
- The /mmoupdate command has been removed. It is replaced by /mcconvert database
- Removed Abilities.Tools.Durability_Loss_Enabled, set Abilities.Tools.Durability_Loss to 0 to disable instead.
- Removed SpoutPlugin support

View File

@ -76,6 +76,7 @@ public class mcMMO extends JavaPlugin {
/* Plugin Checks */
private static boolean combatTagEnabled;
private static boolean healthBarEnabled;
// Config Validation Check
public boolean noErrorsInConfigFiles = true;
@ -116,6 +117,11 @@ public class mcMMO extends JavaPlugin {
}
combatTagEnabled = getServer().getPluginManager().getPlugin("CombatTag") != null;
healthBarEnabled = getServer().getPluginManager().getPlugin("HealthBar") != null;
if (healthBarEnabled) {
getLogger().info("HealthBar plugin found, mcMMO's healthbars are automatically disabled.");
}
databaseManager = DatabaseManagerFactory.getDatabaseManager();
@ -257,6 +263,10 @@ public class mcMMO extends JavaPlugin {
return combatTagEnabled;
}
public static boolean isHealthBarEnabled() {
return healthBarEnabled;
}
/**
* Setup the various storage file paths
*/

View File

@ -40,7 +40,7 @@ public final class MobHealthbarUtils {
* @param damage damage done by the attack triggering this
*/
public static void handleMobHealthbars(Player player, LivingEntity target, double damage) {
if (!Permissions.mobHealthDisplay(player)) {
if (!mcMMO.isHealthBarEnabled() || !Permissions.mobHealthDisplay(player)) {
return;
}

View File

@ -15,7 +15,7 @@ authors: [GJ, NuclearW, bm01, Glitchfinder, TfT_02, t00thpick1]
website: http://dev.bukkit.org/server-mods/mcmmo/
main: com.gmail.nossr50.mcMMO
softdepend: [CombatTag]
softdepend: [CombatTag, HealthBar]
load: STARTUP
commands: