mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 10:14:43 +02:00
Add /mmoxpbar disable
This commit is contained in:
@ -38,6 +38,9 @@ public class XPBarCommand implements TabExecutor {
|
||||
if(option.equalsIgnoreCase(ExperienceBarManager.XPBarSettingTarget.RESET.toString())) {
|
||||
mmoPlayer.getExperienceBarManager().xpBarSettingToggle(ExperienceBarManager.XPBarSettingTarget.RESET, null);
|
||||
return true;
|
||||
} else if(option.equalsIgnoreCase(ExperienceBarManager.XPBarSettingTarget.DISABLE.toString())) {
|
||||
mmoPlayer.getExperienceBarManager().disableAllBars();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@ -80,6 +83,8 @@ public class XPBarCommand implements TabExecutor {
|
||||
return ExperienceBarManager.XPBarSettingTarget.SHOW;
|
||||
case "reset":
|
||||
return ExperienceBarManager.XPBarSettingTarget.RESET;
|
||||
case "disable":
|
||||
return ExperienceBarManager.XPBarSettingTarget.DISABLE;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -92,6 +92,14 @@ public class ExperienceBarManager {
|
||||
experienceBarHideTaskHashMap.remove(primarySkillType);
|
||||
}
|
||||
|
||||
public void disableAllBars() {
|
||||
for(PrimarySkillType primarySkillType : PrimarySkillType.values()) {
|
||||
xpBarSettingToggle(XPBarSettingTarget.HIDE, primarySkillType);
|
||||
}
|
||||
|
||||
NotificationManager.sendPlayerInformationChatOnlyPrefixed(mcMMOPlayer.getPlayer(), "Commands.XPBar.DisableAll");
|
||||
}
|
||||
|
||||
public void xpBarSettingToggle(@NotNull XPBarSettingTarget settingTarget, @Nullable PrimarySkillType skillType) {
|
||||
switch(settingTarget) {
|
||||
case SHOW:
|
||||
@ -147,5 +155,5 @@ public class ExperienceBarManager {
|
||||
}
|
||||
}
|
||||
|
||||
public enum XPBarSettingTarget { SHOW, HIDE, RESET }
|
||||
public enum XPBarSettingTarget { SHOW, HIDE, RESET, DISABLE }
|
||||
}
|
||||
|
@ -1115,3 +1115,4 @@ Commands.Description.mmoxpbar=Player settings for mcMMO XP bars
|
||||
Commands.Description.mmocompat=Information about mcMMO and whether or not its in compatibility mode or fully functional.
|
||||
Compatibility.Layer.Unsupported=[[GOLD]]Compatibility for [[GREEN]]{0}[[GOLD]] is not supported by this version of Minecraft.
|
||||
Compatibility.Layer.PartialSupport=[[GOLD]]Compatibility for [[GREEN]]{0}[[GOLD]] is not fully supported by this version of Minecraft, but mcMMO is running a secondary system to emulate some of the missing features.
|
||||
Commands.XPBar.DisableAll=[[GOLD]] All mcMMO XP bars are now disabled, use /mmoxpbar reset to restore default settings.
|
Reference in New Issue
Block a user