Scoreboards are now OFF by default

I don't like them.
This commit is contained in:
nossr50 2019-01-18 14:20:31 -08:00
parent f5590ce334
commit 29befac27e
14 changed files with 37 additions and 20 deletions

View File

@ -16,6 +16,7 @@ Version 2.1.0
+ Added links to mcMMO related websites to various commands + Added links to mcMMO related websites to various commands
+ Certain elements of mcMMO's UI have been restyled + Certain elements of mcMMO's UI have been restyled
+ Added the tagline "Overhaul Era" to various locations until 3.0.0 comes out + Added the tagline "Overhaul Era" to various locations until 3.0.0 comes out
! (Scoreboards) Scoreboards are now disabled by default, I don't like them. You can turn them back on in config.yml
+ (Experience) Coral (blocks) now give Mining XP + (Experience) Coral (blocks) now give Mining XP
+ (Experience) Coral (plants) now give Herbalism XP + (Experience) Coral (plants) now give Herbalism XP
+ (Experience) Blue Ice now gives Mining XP + (Experience) Blue Ice now gives Mining XP

View File

@ -31,7 +31,7 @@ public class McscoreboardCommand implements TabExecutor {
} }
if (args[0].equalsIgnoreCase("keep")) { if (args[0].equalsIgnoreCase("keep")) {
if (!Config.getInstance().getAllowKeepBoard()) { if (!Config.getInstance().getAllowKeepBoard() || !Config.getInstance().getScoreboardsEnabled()) {
sender.sendMessage(LocaleLoader.getString("Commands.Disabled")); sender.sendMessage(LocaleLoader.getString("Commands.Disabled"));
return true; return true;
} }

View File

@ -40,7 +40,7 @@ public class InspectCommand implements TabExecutor {
return true; return true;
} }
if (sender instanceof Player && Config.getInstance().getInspectUseBoard()) { if (Config.getInstance().getScoreboardsEnabled() && sender instanceof Player && Config.getInstance().getInspectUseBoard()) {
ScoreboardManager.enablePlayerInspectScoreboard((Player) sender, profile); ScoreboardManager.enablePlayerInspectScoreboard((Player) sender, profile);
if (!Config.getInstance().getInspectUseChat()) { if (!Config.getInstance().getInspectUseChat()) {
@ -79,7 +79,7 @@ public class InspectCommand implements TabExecutor {
return true; return true;
} }
if (sender instanceof Player && Config.getInstance().getInspectUseBoard()) { if (Config.getInstance().getScoreboardsEnabled() && sender instanceof Player && Config.getInstance().getInspectUseBoard()) {
ScoreboardManager.enablePlayerInspectScoreboard((Player) sender, mcMMOPlayer.getProfile()); ScoreboardManager.enablePlayerInspectScoreboard((Player) sender, mcMMOPlayer.getProfile());
if (!Config.getInstance().getInspectUseChat()) { if (!Config.getInstance().getInspectUseChat()) {

View File

@ -30,7 +30,7 @@ public class MccooldownCommand implements TabExecutor {
case 0: case 0:
Player player = (Player) sender; Player player = (Player) sender;
if (Config.getInstance().getCooldownUseBoard()) { if (Config.getInstance().getScoreboardsEnabled() && Config.getInstance().getCooldownUseBoard()) {
ScoreboardManager.enablePlayerCooldownScoreboard(player); ScoreboardManager.enablePlayerCooldownScoreboard(player);
if (!Config.getInstance().getCooldownUseChat()) { if (!Config.getInstance().getCooldownUseChat()) {

View File

@ -28,7 +28,7 @@ public class McstatsCommand implements TabExecutor {
case 0: case 0:
Player player = (Player) sender; Player player = (Player) sender;
if (Config.getInstance().getStatsUseBoard()) { if (Config.getInstance().getStatsUseBoard() && Config.getInstance().getScoreboardsEnabled()) {
ScoreboardManager.enablePlayerStatsScoreboard(player); ScoreboardManager.enablePlayerStatsScoreboard(player);
if (!Config.getInstance().getStatsUseChat()) { if (!Config.getInstance().getStatsUseChat()) {

View File

@ -92,7 +92,7 @@ public abstract class SkillCommand implements TabExecutor {
//Link Header //Link Header
TextComponentFactory.sendPlayerUrlHeader(player); TextComponentFactory.sendPlayerUrlHeader(player);
if (Config.getInstance().getSkillUseBoard()) { if (Config.getInstance().getScoreboardsEnabled() && Config.getInstance().getSkillUseBoard()) {
ScoreboardManager.enablePlayerSkillScoreboard(player, skill); ScoreboardManager.enablePlayerSkillScoreboard(player, skill);
} }

View File

@ -289,7 +289,7 @@ public class Config extends AutoUpdateConfigLoader {
public int getMobHealthbarTime() { return config.getInt("Mob_Healthbar.Display_Time", 3); } public int getMobHealthbarTime() { return config.getInt("Mob_Healthbar.Display_Time", 3); }
/* Scoreboards */ /* Scoreboards */
public boolean getScoreboardsEnabled() { return config.getBoolean("Scoreboard.Enabled", true); } public boolean getScoreboardsEnabled() { return config.getBoolean("Scoreboard.UseScoreboards", true); }
public boolean getPowerLevelTagsEnabled() { return config.getBoolean("Scoreboard.Power_Level_Tags", false); } public boolean getPowerLevelTagsEnabled() { return config.getBoolean("Scoreboard.Power_Level_Tags", false); }
public boolean getAllowKeepBoard() { return config.getBoolean("Scoreboard.Allow_Keep", true); } public boolean getAllowKeepBoard() { return config.getBoolean("Scoreboard.Allow_Keep", true); }
public int getTipsAmount() { return config.getInt("Scoreboard.Tips_Amount", 5); } public int getTipsAmount() { return config.getInt("Scoreboard.Tips_Amount", 5); }

View File

@ -956,6 +956,8 @@ public class McMMOPlayer {
} }
UserManager.remove(thisPlayer); UserManager.remove(thisPlayer);
if(Config.getInstance().getScoreboardsEnabled())
ScoreboardManager.teardownPlayer(thisPlayer); ScoreboardManager.teardownPlayer(thisPlayer);
if (inParty()) { if (inParty()) {

View File

@ -30,6 +30,7 @@ public class SelfListener implements Listener {
Player player = event.getPlayer(); Player player = event.getPlayer();
PrimarySkillType skill = event.getSkill(); PrimarySkillType skill = event.getSkill();
if(Config.getInstance().getScoreboardsEnabled())
ScoreboardManager.handleLevelUp(player, skill); ScoreboardManager.handleLevelUp(player, skill);
if (!Config.getInstance().getLevelUpEffectsEnabled()) { if (!Config.getInstance().getLevelUpEffectsEnabled()) {
@ -43,11 +44,13 @@ public class SelfListener implements Listener {
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerXp(McMMOPlayerXpGainEvent event) { public void onPlayerXp(McMMOPlayerXpGainEvent event) {
if(Config.getInstance().getScoreboardsEnabled())
ScoreboardManager.handleXp(event.getPlayer(), event.getSkill()); ScoreboardManager.handleXp(event.getPlayer(), event.getSkill());
} }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onAbility(McMMOPlayerAbilityActivateEvent event) { public void onAbility(McMMOPlayerAbilityActivateEvent event) {
if(Config.getInstance().getScoreboardsEnabled())
ScoreboardManager.cooldownUpdate(event.getPlayer(), event.getSkill()); ScoreboardManager.cooldownUpdate(event.getPlayer(), event.getSkill());
} }

View File

@ -219,7 +219,11 @@ public class mcMMO extends JavaPlugin {
UserManager.saveAll(); // Make sure to save player information if the server shuts down UserManager.saveAll(); // Make sure to save player information if the server shuts down
UserManager.clearAll(); UserManager.clearAll();
PartyManager.saveParties(); // Save our parties PartyManager.saveParties(); // Save our parties
//TODO: Needed?
if(Config.getInstance().getScoreboardsEnabled())
ScoreboardManager.teardownAll(); ScoreboardManager.teardownAll();
formulaManager.saveFormula(); formulaManager.saveFormula();
holidayManager.saveAnniversaryFiles(); holidayManager.saveAnniversaryFiles();
placeStore.saveAll(); // Save our metadata placeStore.saveAll(); // Save our metadata

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.runnables.commands; package com.gmail.nossr50.runnables.commands;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
@ -29,7 +30,7 @@ public class McrankCommandDisplayTask extends BukkitRunnable {
@Override @Override
public void run() { public void run() {
if (useBoard) { if (useBoard && Config.getInstance().getScoreboardsEnabled()) {
displayBoard(); displayBoard();
} }

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.runnables.commands; package com.gmail.nossr50.runnables.commands;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.database.PlayerStat; import com.gmail.nossr50.datatypes.database.PlayerStat;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
@ -33,7 +34,7 @@ public class MctopCommandDisplayTask extends BukkitRunnable {
@Override @Override
public void run() { public void run() {
if (useBoard) { if (useBoard && Config.getInstance().getScoreboardsEnabled()) {
displayBoard(); displayBoard();
} }

View File

@ -76,16 +76,21 @@ public class PlayerProfileLoadingTask extends BukkitRunnable {
mcMMOPlayer.setupPartyData(); mcMMOPlayer.setupPartyData();
UserManager.track(mcMMOPlayer); UserManager.track(mcMMOPlayer);
mcMMOPlayer.actualizeRespawnATS(); mcMMOPlayer.actualizeRespawnATS();
ScoreboardManager.setupPlayer(player);
if (Config.getInstance().getShowProfileLoadedMessage()) { if (Config.getInstance().getScoreboardsEnabled()) {
player.sendMessage(LocaleLoader.getString("Profile.Loading.Success")); ScoreboardManager.setupPlayer(player);
}
if (Config.getInstance().getShowStatsAfterLogin()) { if (Config.getInstance().getShowStatsAfterLogin()) {
ScoreboardManager.enablePlayerStatsScoreboard(player); ScoreboardManager.enablePlayerStatsScoreboard(player);
new McScoreboardKeepTask(player).runTaskLater(mcMMO.p, 1 * Misc.TICK_CONVERSION_FACTOR); new McScoreboardKeepTask(player).runTaskLater(mcMMO.p, 1 * Misc.TICK_CONVERSION_FACTOR);
} }
} }
if (Config.getInstance().getShowProfileLoadedMessage()) {
player.sendMessage(LocaleLoader.getString("Profile.Loading.Success"));
}
}
} }
} }

View File

@ -44,7 +44,7 @@ General:
### ###
Scoreboard: Scoreboard:
# Set this to true to enable scoreboards # Set this to true to enable scoreboards
Enable: true UseScoreboards: false
# Display player's power levels below their names? # Display player's power levels below their names?
Power_Level_Tags: false Power_Level_Tags: false