Mob Health bars global toggle

This commit is contained in:
t00thpick1 2017-10-03 23:32:54 -04:00
parent 87ebf7023f
commit 9df72e61a2
3 changed files with 7 additions and 3 deletions

View File

@ -265,6 +265,8 @@ public class Config extends AutoUpdateConfigLoader {
public boolean getLevelUpSoundsEnabled() { return config.getBoolean("General.LevelUp_Sounds", true); } public boolean getLevelUpSoundsEnabled() { return config.getBoolean("General.LevelUp_Sounds", true); }
public boolean getRefreshChunksEnabled() { return config.getBoolean("General.Refresh_Chunks", false); } public boolean getRefreshChunksEnabled() { return config.getBoolean("General.Refresh_Chunks", false); }
public boolean getMobHealthbarEnabled() { return config.getBoolean("Mob_Healthbar.Enabled", true); }
/* Mob Healthbar */ /* Mob Healthbar */
public MobHealthbarType getMobHealthbarDefault() { public MobHealthbarType getMobHealthbarDefault() {
try { try {

View File

@ -16,7 +16,7 @@ import com.gmail.nossr50.runnables.MobHealthDisplayUpdaterTask;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
public final class MobHealthbarUtils { public final class MobHealthbarUtils {
private MobHealthbarUtils() {}; private MobHealthbarUtils() {}
/** /**
* Fix issues with death messages caused by the mob healthbars. * Fix issues with death messages caused by the mob healthbars.
@ -40,7 +40,7 @@ public final class MobHealthbarUtils {
* @param damage damage done by the attack triggering this * @param damage damage done by the attack triggering this
*/ */
public static void handleMobHealthbars(Player player, LivingEntity target, double damage) { public static void handleMobHealthbars(Player player, LivingEntity target, double damage) {
if (mcMMO.isHealthBarPluginEnabled() || !Permissions.mobHealthDisplay(player)) { if (mcMMO.isHealthBarPluginEnabled() || !Permissions.mobHealthDisplay(player) || !Config.getInstance().getMobHealthbarEnabled()) {
return; return;
} }

View File

@ -102,8 +102,10 @@ Scoreboard:
LevelUp_Time: 5 LevelUp_Time: 5
Mob_Healthbar: Mob_Healthbar:
# Display_Type: Default display for mob health bars - HEARTS, BAR, or DISABLED # Enabled: Whether or not the feature is enabled at all
# Display_Type: Per player Default display for mob health bars - HEARTS, BAR, or DISABLED
# Display_Time: Amount of time (in seconds) to display. To display permanently, set to -1 # Display_Time: Amount of time (in seconds) to display. To display permanently, set to -1
Enabled: true
Display_Type: HEARTS Display_Type: HEARTS
Display_Time: 3 Display_Time: 3