Add /mmoxpbar disable

This commit is contained in:
nossr50 2020-05-06 09:19:17 -07:00
parent f584783490
commit 899a0152ba
5 changed files with 19 additions and 12 deletions

11
1
View File

@ -1,11 +0,0 @@
SkillShot tweaks
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
# Your branch is up to date with 'origin/master'.
#
# Changes to be committed:
# modified: src/main/java/com/gmail/nossr50/skills/archery/Archery.java
# modified: src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java
#

View File

@ -1,3 +1,7 @@
Version 2.1.129
Added new subcommand /mmoxpbar disable - Hides all mcMMO XP bars
New locale string 'Commands.XPBar.DisableAll'
Version 2.1.128 Version 2.1.128
The first rank of Iron Arm for Unarmed now only gives 1.5 bonus damage instead of 4 (other ranks are the same as before) The first rank of Iron Arm for Unarmed now only gives 1.5 bonus damage instead of 4 (other ranks are the same as before)
Blast Mining nerf reverted Blast Mining nerf reverted

View File

@ -38,6 +38,9 @@ public class XPBarCommand implements TabExecutor {
if(option.equalsIgnoreCase(ExperienceBarManager.XPBarSettingTarget.RESET.toString())) { if(option.equalsIgnoreCase(ExperienceBarManager.XPBarSettingTarget.RESET.toString())) {
mmoPlayer.getExperienceBarManager().xpBarSettingToggle(ExperienceBarManager.XPBarSettingTarget.RESET, null); mmoPlayer.getExperienceBarManager().xpBarSettingToggle(ExperienceBarManager.XPBarSettingTarget.RESET, null);
return true; return true;
} else if(option.equalsIgnoreCase(ExperienceBarManager.XPBarSettingTarget.DISABLE.toString())) {
mmoPlayer.getExperienceBarManager().disableAllBars();
return true;
} else { } else {
return false; return false;
} }
@ -80,6 +83,8 @@ public class XPBarCommand implements TabExecutor {
return ExperienceBarManager.XPBarSettingTarget.SHOW; return ExperienceBarManager.XPBarSettingTarget.SHOW;
case "reset": case "reset":
return ExperienceBarManager.XPBarSettingTarget.RESET; return ExperienceBarManager.XPBarSettingTarget.RESET;
case "disable":
return ExperienceBarManager.XPBarSettingTarget.DISABLE;
} }
return null; return null;

View File

@ -92,6 +92,14 @@ public class ExperienceBarManager {
experienceBarHideTaskHashMap.remove(primarySkillType); 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) { public void xpBarSettingToggle(@NotNull XPBarSettingTarget settingTarget, @Nullable PrimarySkillType skillType) {
switch(settingTarget) { switch(settingTarget) {
case SHOW: case SHOW:
@ -147,5 +155,5 @@ public class ExperienceBarManager {
} }
} }
public enum XPBarSettingTarget { SHOW, HIDE, RESET } public enum XPBarSettingTarget { SHOW, HIDE, RESET, DISABLE }
} }

View File

@ -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. 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.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. 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.