1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2026-02-21 11:13:00 +01:00

Disable mob healthbars for boss mobs!

Fixes #1210
This commit is contained in:
TfT_02
2013-06-28 13:36:48 +02:00
parent 6fea7c8d74
commit 1edb11cedf
3 changed files with 33 additions and 0 deletions

View File

@@ -44,6 +44,10 @@ public final class MobHealthbarUtils {
return;
}
if (isBoss(target)) {
return;
}
PlayerProfile profile = UserManager.getPlayer(player).getProfile();
if (profile.getMobHealthbarType() == null) {
@@ -149,4 +153,21 @@ public final class MobHealthbarUtils {
return healthbar;
}
/**
* Check if a given LivingEntity is a boss.
*
* @param livingEntity The {@link LivingEntity} of the livingEntity to check
* @return true if the livingEntity is a boss, false otherwise
*/
public static boolean isBoss(LivingEntity livingEntity) {
switch (livingEntity.getType()) {
case ENDER_DRAGON:
case WITHER:
return true;
default:
return ModUtils.isCustomBossEntity(livingEntity);
}
}
}