Scoreboard config part 1

This commit is contained in:
nossr50
2019-03-13 09:42:57 -07:00
parent 1c289cfcdf
commit f00601931d
38 changed files with 708 additions and 96 deletions

View File

@@ -53,7 +53,7 @@ public class ScoreboardManager {
*/
static {
/*
* We need immutable objects for our Scoreboard's labels
* We need immutable objects for our ConfigScoreboard's labels
*/
ImmutableMap.Builder<PrimarySkillType, String> skillLabelBuilder = ImmutableMap.builder();
ImmutableMap.Builder<SuperAbilityType, String> abilityLabelBuilder = ImmutableMap.builder();
@@ -64,7 +64,7 @@ public class ScoreboardManager {
* Stylizes the targetBoard in a Rainbow Pattern
* This is off by default
*/
if (MainConfig.getInstance().getScoreboardRainbows()) {
if (mcMMO.getScoreboardSettings().getUseRainbowSkillStyling()) {
// Everything but black, gray, gold
List<ChatColor> colors = Lists.newArrayList(
ChatColor.WHITE,
@@ -145,7 +145,7 @@ public class ScoreboardManager {
}
private static String formatAbility(ChatColor color, String abilityName) {
if (MainConfig.getInstance().getShowAbilityNames()) {
if (mcMMO.getScoreboardSettings().getUseAbilityNamesOverGenerics()) {
return getShortenedName(color + abilityName);
}
else {
@@ -218,7 +218,7 @@ public class ScoreboardManager {
}
}
if (MainConfig.getInstance().getPowerLevelTagsEnabled() && !dirtyPowerLevels.contains(playerName)) {
if (mcMMO.getScoreboardSettings().getPowerLevelTagsEnabled() && !dirtyPowerLevels.contains(playerName)) {
dirtyPowerLevels.add(playerName);
}
@@ -381,7 +381,7 @@ public class ScoreboardManager {
* @return the main targetBoard objective, or null if disabled
*/
public static Objective getPowerLevelObjective() {
if (!MainConfig.getInstance().getPowerLevelTagsEnabled()) {
if (!mcMMO.getScoreboardSettings().getPowerLevelTagsEnabled()) {
Objective objective = mcMMO.p.getServer().getScoreboardManager().getMainScoreboard().getObjective(POWER_OBJECTIVE);
if (objective != null) {

View File

@@ -54,7 +54,7 @@ public class ScoreboardWrapper {
sidebarObjective = this.scoreboard.registerNewObjective(ScoreboardManager.SIDEBAR_OBJECTIVE, "dummy");
powerObjective = this.scoreboard.registerNewObjective(ScoreboardManager.POWER_OBJECTIVE, "dummy");
if (MainConfig.getInstance().getPowerLevelTagsEnabled()) {
if (mcMMO.getScoreboardSettings().getPowerLevelTagsEnabled()) {
powerObjective.setDisplayName(ScoreboardManager.TAG_POWER_LEVEL);
powerObjective.setDisplaySlot(DisplaySlot.BELOW_NAME);
@@ -203,11 +203,11 @@ public class ScoreboardWrapper {
revertTask = new ScoreboardChangeTask().runTaskLater(mcMMO.p, ticks);
// TODO is there any way to do the time that looks acceptable?
// player.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Timer", StringUtils.capitalize(sidebarType.toString().toLowerCase()), ticks / 20F));
// player.sendMessage(LocaleLoader.getString("Commands.ConfigScoreboard.Timer", StringUtils.capitalize(sidebarType.toString().toLowerCase()), ticks / 20F));
PlayerProfile profile = UserManager.getPlayer(player).getProfile();
if (profile.getScoreboardTipsShown() >= MainConfig.getInstance().getTipsAmount()) {
if (profile.getScoreboardTipsShown() >= mcMMO.getScoreboardSettings().getTipsAmount()) {
return;
}