mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-01 21:24:43 +02:00
Scoreboard config part 1
This commit is contained in:
@ -5,6 +5,7 @@ import com.gmail.nossr50.config.collectionconfigs.SalvageConfig;
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.config.hocon.SerializedConfigLoader;
|
||||
import com.gmail.nossr50.config.hocon.database.ConfigDatabase;
|
||||
import com.gmail.nossr50.config.hocon.scoreboard.ConfigScoreboard;
|
||||
import com.gmail.nossr50.config.party.ItemWeightConfig;
|
||||
import com.gmail.nossr50.config.skills.alchemy.PotionConfig;
|
||||
import com.gmail.nossr50.config.treasure.ExcavationTreasureConfig;
|
||||
@ -61,6 +62,7 @@ public final class ConfigManager {
|
||||
/* CONFIG INSTANCES */
|
||||
|
||||
private SerializedConfigLoader<ConfigDatabase> configDatabase;
|
||||
private SerializedConfigLoader<ConfigScoreboard> configScoreboard;
|
||||
private MainConfig mainConfig;
|
||||
private FishingTreasureConfig fishingTreasureConfig;
|
||||
private ExcavationTreasureConfig excavationTreasureConfig;
|
||||
@ -91,7 +93,10 @@ public final class ConfigManager {
|
||||
// I'm pretty these are supposed to be done in a specific order, so don't rearrange them willy nilly
|
||||
|
||||
//TODO: Not sure about the order of MainConfig
|
||||
//Serialized Configs
|
||||
configDatabase = new SerializedConfigLoader<>(ConfigDatabase.class, "database_settings.conf", null);
|
||||
configScoreboard = new SerializedConfigLoader<>(ConfigScoreboard.class, "scoreboard.conf", null);
|
||||
|
||||
mainConfig = new MainConfig();
|
||||
|
||||
fishingTreasureConfig = new FishingTreasureConfig();
|
||||
@ -306,4 +311,6 @@ public final class ConfigManager {
|
||||
}
|
||||
|
||||
public ConfigDatabase getConfigDatabase() { return configDatabase.getConfig(); }
|
||||
|
||||
public ConfigScoreboard getConfigScoreboard() { return configScoreboard.getConfig(); }
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public class MainConfig extends ConfigValidated {
|
||||
public static final String DISPLAY_TYPE = "Display_Type";
|
||||
public static final String HEARTS = "HEARTS";
|
||||
public static final String DISPLAY_TIME = "Display_Time";
|
||||
public static final String SCOREBOARD = "Scoreboard";
|
||||
public static final String SCOREBOARD = "ConfigScoreboard";
|
||||
public static final String USE_SCOREBOARDS = "UseScoreboards";
|
||||
public static final String POWER = "Power_";
|
||||
public static final String POWER_LEVEL_TAGS = POWER + "Level_Tags";
|
||||
@ -263,43 +263,43 @@ public class MainConfig extends ConfigValidated {
|
||||
|
||||
/* Scoreboards */
|
||||
/*if (getRankScoreboardTime() != -1 && getRankScoreboardTime() <= 0) {
|
||||
reason.add("Scoreboard.Types.Rank.Display_Time should be greater than 0, or -1!");
|
||||
reason.add("ConfigScoreboard.Types.Rank.Display_Time should be greater than 0, or -1!");
|
||||
}
|
||||
|
||||
if (getStatsScoreboardTime() != -1 && getStatsScoreboardTime() <= 0) {
|
||||
reason.add("Scoreboard.Types.Stats.Display_Time should be greater than 0, or -1!");
|
||||
reason.add("ConfigScoreboard.Types.Stats.Display_Time should be greater than 0, or -1!");
|
||||
}
|
||||
|
||||
if (getTopScoreboardTime() != -1 && getTopScoreboardTime() <= 0) {
|
||||
reason.add("Scoreboard.Types.Top.Display_Time should be greater than 0, or -1!");
|
||||
reason.add("ConfigScoreboard.Types.Top.Display_Time should be greater than 0, or -1!");
|
||||
}
|
||||
|
||||
if (getInspectScoreboardTime() != -1 && getInspectScoreboardTime() <= 0) {
|
||||
reason.add("Scoreboard.Types.Inspect.Display_Time should be greater than 0, or -1!");
|
||||
reason.add("ConfigScoreboard.Types.Inspect.Display_Time should be greater than 0, or -1!");
|
||||
}
|
||||
|
||||
if (getSkillScoreboardTime() != -1 && getSkillScoreboardTime() <= 0) {
|
||||
reason.add("Scoreboard.Types.Skill.Display_Time should be greater than 0, or -1!");
|
||||
reason.add("ConfigScoreboard.Types.Skill.Display_Time should be greater than 0, or -1!");
|
||||
}
|
||||
|
||||
if (getSkillLevelUpTime() != -1 && getSkillScoreboardTime() <= 0) {
|
||||
reason.add("Scoreboard.Types.Skill.Display_Time should be greater than 0, or -1!");
|
||||
reason.add("ConfigScoreboard.Types.Skill.Display_Time should be greater than 0, or -1!");
|
||||
}
|
||||
|
||||
if (!(getRankUseChat() || getRankUseBoard())) {
|
||||
reason.add("Either Board or Print in Scoreboard.Types.Rank must be true!");
|
||||
reason.add("Either Board or Print in ConfigScoreboard.Types.Rank must be true!");
|
||||
}
|
||||
|
||||
if (!(getTopUseChat() || getTopUseBoard())) {
|
||||
reason.add("Either Board or Print in Scoreboard.Types.Top must be true!");
|
||||
reason.add("Either Board or Print in ConfigScoreboard.Types.Top must be true!");
|
||||
}
|
||||
|
||||
if (!(getStatsUseChat() || getStatsUseBoard())) {
|
||||
reason.add("Either Board or Print in Scoreboard.Types.Stats must be true!");
|
||||
reason.add("Either Board or Print in ConfigScoreboard.Types.Stats must be true!");
|
||||
}
|
||||
|
||||
if (!(getInspectUseChat() || getInspectUseBoard())) {
|
||||
reason.add("Either Board or Print in Scoreboard.Types.Inspect must be true!");
|
||||
reason.add("Either Board or Print in ConfigScoreboard.Types.Inspect must be true!");
|
||||
}*/
|
||||
|
||||
/* Database Purging */
|
||||
@ -540,30 +540,6 @@ public class MainConfig extends ConfigValidated {
|
||||
return getBooleanValue(SCOREBOARD, USE_SCOREBOARDS);
|
||||
}
|
||||
|
||||
public boolean getPowerLevelTagsEnabled() {
|
||||
return getBooleanValue(SCOREBOARD, POWER_LEVEL_TAGS);
|
||||
}
|
||||
|
||||
public boolean getAllowKeepBoard() {
|
||||
return getBooleanValue(SCOREBOARD, ALLOW_KEEP);
|
||||
}
|
||||
|
||||
public int getTipsAmount() {
|
||||
return getIntValue(SCOREBOARD, TIPS_AMOUNT);
|
||||
}
|
||||
|
||||
public boolean getShowStatsAfterLogin() {
|
||||
return getBooleanValue(SCOREBOARD, SHOW_STATS_AFTER_LOGIN);
|
||||
}
|
||||
|
||||
public boolean getScoreboardRainbows() {
|
||||
return getBooleanValue(SCOREBOARD, RAINBOWS);
|
||||
}
|
||||
|
||||
public boolean getShowAbilityNames() {
|
||||
return getBooleanValue(SCOREBOARD, ABILITY_NAMES);
|
||||
}
|
||||
|
||||
public boolean getRankUseChat() {
|
||||
return getBooleanValue(SCOREBOARD, TYPES, RANK, PRINT);
|
||||
}
|
||||
|
@ -1,7 +1,12 @@
|
||||
package com.gmail.nossr50.config.hocon;
|
||||
package com.gmail.nossr50.config.hocon.antiexploit;
|
||||
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class AntiExploit {
|
||||
|
||||
/*
|
||||
* CONFIG NODES
|
||||
*/
|
||||
|
||||
}
|
||||
|
@ -10,12 +10,13 @@ public class ConfigDatabase {
|
||||
* CONFIG NODES
|
||||
*/
|
||||
|
||||
@Setting(value = "MySQL", comment = "Settings for using MySQL or MariaDB database")
|
||||
@Setting(value = "MySQL", comment = "Settings for using MySQL or MariaDB database" +
|
||||
"\nI recommend using MariaDB, its completely compatible with MySQL and runs a lot better" +
|
||||
"\nI also recommend having the MySQL/MariaDB server in the same datacenter or LAN as your Minecraft server" +
|
||||
"\nmcMMO uses ASYNC threaded requests for SQL, so the latency is not really a big deal," +
|
||||
" but ideally you want low latency to your SQL server anyways!")
|
||||
private ConfigSectionMySQL configSectionMySQL = new ConfigSectionMySQL();
|
||||
|
||||
@Setting(value = "Enabled", comment = "If set to true, mcMMO will use MySQL/MariaDB instead of FlatFile storage")
|
||||
private boolean enabled = true;
|
||||
|
||||
/*
|
||||
* GETTER BOILERPLATE
|
||||
*/
|
||||
|
@ -6,6 +6,10 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
@ConfigSerializable
|
||||
public class ConfigSectionDatabase {
|
||||
|
||||
/*
|
||||
* CONFIG NODES
|
||||
*/
|
||||
|
||||
@Setting(value = "Database_Name", comment = "The database name for your DB, this DB must already exist on the SQL server.")
|
||||
private String databaseName = "example_database_name";
|
||||
|
||||
|
@ -6,13 +6,22 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
@ConfigSerializable
|
||||
public class ConfigSectionMaxConnections {
|
||||
|
||||
@Setting(value = "Misc_Connection_Limit")
|
||||
/* DEFAULT VALUES */
|
||||
private static final int MISC_DEFAULT = 30;
|
||||
private static final int LOAD_DEFAULT = 30;
|
||||
private static final int SAVE_DEFAULT = 30;
|
||||
|
||||
/*
|
||||
* CONFIG NODES
|
||||
*/
|
||||
|
||||
@Setting(value = "Misc_Connection_Limit", comment = "Default value: "+MISC_DEFAULT)
|
||||
private int misc = 30;
|
||||
|
||||
@Setting(value = "Load_Connection_Limit")
|
||||
@Setting(value = "Load_Connection_Limit", comment = "Default value: "+LOAD_DEFAULT)
|
||||
private int load = 30;
|
||||
|
||||
@Setting(value = "Save_Connection_Limit")
|
||||
@Setting(value = "Save_Connection_Limit", comment = "Default value: "+SAVE_DEFAULT)
|
||||
private int save = 30;
|
||||
|
||||
/*
|
||||
|
@ -5,13 +5,23 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigSectionMaxPoolSize {
|
||||
@Setting(value = "Misc_Pool")
|
||||
|
||||
/* DEFAULT VALUES */
|
||||
private static final int MISC_DEFAULT = 10;
|
||||
private static final int LOAD_DEFAULT = 20;
|
||||
private static final int SAVE_DEFAULT = 20;
|
||||
|
||||
/*
|
||||
* CONFIG NODES
|
||||
*/
|
||||
|
||||
@Setting(value = "Misc_Pool", comment = "Default value: "+MISC_DEFAULT)
|
||||
private int misc = 10;
|
||||
|
||||
@Setting(value = "Load_Pool")
|
||||
@Setting(value = "Load_Pool", comment = "Default value: "+LOAD_DEFAULT)
|
||||
private int load = 20;
|
||||
|
||||
@Setting(value = "Save_Pool")
|
||||
@Setting(value = "Save_Pool", comment = "Default value: "+SAVE_DEFAULT)
|
||||
private int save = 20;
|
||||
|
||||
/*
|
||||
|
@ -7,8 +7,18 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
@ConfigSerializable
|
||||
public class ConfigSectionMySQL {
|
||||
|
||||
@Setting(value = "Enabled", comment = "If set to true, mcMMO will use MySQL/MariaDB instead of FlatFile storage")
|
||||
private boolean enabled = true;
|
||||
/* DEFAULT VALUES */
|
||||
private static final boolean USE_MYSQL_DEFAULT = false;
|
||||
|
||||
/*
|
||||
* CONFIG NODES
|
||||
*/
|
||||
|
||||
@Setting(value = "Use_MySQL", comment = "If set to true, mcMMO will use MySQL/MariaDB instead of FlatFile storage" +
|
||||
"\nIt is highly recommended to use a MySQL/MariaDB server over FlatFile," +
|
||||
" especially if the number of players on your Minecraft server is fairly high." +
|
||||
"\nDefault value: "+USE_MYSQL_DEFAULT)
|
||||
private boolean useMySQL = USE_MYSQL_DEFAULT;
|
||||
|
||||
@Setting(value = "User", comment = "Your MySQL User Settings")
|
||||
private ConfigSectionUser configSectionUser = new ConfigSectionUser();
|
||||
@ -24,7 +34,7 @@ public class ConfigSectionMySQL {
|
||||
*/
|
||||
|
||||
public boolean isMySQLEnabled() {
|
||||
return enabled;
|
||||
return useMySQL;
|
||||
}
|
||||
|
||||
public ConfigSectionUser getConfigSectionUser() {
|
||||
@ -39,6 +49,10 @@ public class ConfigSectionMySQL {
|
||||
return userConfigSectionServer;
|
||||
}
|
||||
|
||||
/*
|
||||
* HELPER METHODS
|
||||
*/
|
||||
|
||||
public int getMaxPoolSize(SQLDatabaseManager.PoolIdentifier poolIdentifier)
|
||||
{
|
||||
switch (poolIdentifier)
|
||||
|
@ -6,7 +6,12 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
@ConfigSerializable
|
||||
public class ConfigSectionUser {
|
||||
|
||||
@Setting(value = "User_Name", comment = "The authorized user for your MySQL/MariaDB DB")
|
||||
/*
|
||||
* CONFIG NODES
|
||||
*/
|
||||
|
||||
@Setting(value = "User_Name", comment = "The authorized user for your MySQL/MariaDB DB" +
|
||||
"\nThis needs to be an existing user")
|
||||
private String username = "example_user_name";
|
||||
|
||||
@Setting(value = "User_Password", comment = "The password for your authorized user")
|
||||
@ -24,5 +29,4 @@ public class ConfigSectionUser {
|
||||
return password;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -6,18 +6,30 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
@ConfigSerializable
|
||||
public class UserConfigSectionServer {
|
||||
|
||||
/* DEFAULT VALUES */
|
||||
private static final boolean USE_SSL_DEFAULT = true;
|
||||
private static final int SERVER_PORT_DEFAULT = 3306;
|
||||
private static final String SERVER_ADDRESS_DEFAULT = "localhost";
|
||||
|
||||
/*
|
||||
* CONFIG NODES
|
||||
*/
|
||||
|
||||
@Setting(value = "Use_SSL", comment = "Enables SSL for MySQL/MariaDB connections." +
|
||||
"\nIf your SQL server supports SSL, it is recommended to have it on but not necessary." +
|
||||
"\nIf you run into any issues involving SSL, its best to just turn this off.")
|
||||
private boolean useSSL = true;
|
||||
"\nIf you run into any issues involving SSL, its best to just turn this off." +
|
||||
"\nDefault value: "+USE_SSL_DEFAULT)
|
||||
private boolean useSSL = USE_SSL_DEFAULT;
|
||||
|
||||
@Setting(value = "Server_Port", comment = "Your MySQL/MariaDB server port" +
|
||||
"\nThe default port is typically 3306 for MySQL, but every server configuration is different!")
|
||||
private int serverPort = 3306;
|
||||
"\nThe default port is typically 3306 for MySQL, but every server configuration is different!" +
|
||||
"\nDefault value: "+SERVER_PORT_DEFAULT)
|
||||
private int serverPort = SERVER_PORT_DEFAULT;
|
||||
|
||||
@Setting(value = "Server_Address", comment = "The address for your MySQL/MariaDB server" +
|
||||
"If the MySQL server is hosted on the same machine, you can use the localhost alias")
|
||||
private String serverAddress = "localhost";
|
||||
"If the MySQL server is hosted on the same machine, you can use the localhost alias" +
|
||||
"\nDefault value: "+SERVER_ADDRESS_DEFAULT)
|
||||
private String serverAddress = SERVER_ADDRESS_DEFAULT;
|
||||
|
||||
@Setting(value = "Max_Connections", comment = "This setting is the max simultaneous MySQL/MariaDB connections allowed at a time." +
|
||||
"\nThis needs to be high enough to support multiple player logins in quick succession, it is recommended that you do not lower these values")
|
||||
|
@ -0,0 +1,157 @@
|
||||
package com.gmail.nossr50.config.hocon.scoreboard;
|
||||
|
||||
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigScoreboard {
|
||||
/* DEFAULT VALUES */
|
||||
private static final boolean USE_SCOREBOARDS_DEFAULT = false;
|
||||
private static final boolean POWER_LEVEL_DISPLAY_DEFAULT = false;
|
||||
private static final boolean SHOW_PLAYER_STATS_SCOREBOARD_AFTER_LOGIN_DEFAULT = false;
|
||||
private static final boolean USE_RAINBOW_SKILL_COLORING_DEFAULT = true;
|
||||
private static final boolean USE_SUPER_ABILITY_NAME_INSTEAD_OF_GENERIC = true;
|
||||
|
||||
private static final int SHOW_TIPS_LIMIT_DEFAULT = 10;
|
||||
|
||||
/*
|
||||
* CONFIG NODES
|
||||
*/
|
||||
|
||||
@Setting(value = "Use_Scoreboards", comment = "Whether or not mcMMO should use make use of scoreboards." +
|
||||
"\nPersonally, I find scoreboards quite ugly, so I've disabled them by default." +
|
||||
"\nMost of their functionality has been replaced by the new XP bars (Boss Bars)" +
|
||||
"\nIf you still wish to use scoreboards, you can, just turn this setting on." +
|
||||
"\nDefault value: "+ USE_SCOREBOARDS_DEFAULT)
|
||||
private boolean useScoreboards = USE_SCOREBOARDS_DEFAULT;
|
||||
|
||||
@Setting(value = "Display_Power_Levels_Below_Player_Names",
|
||||
comment = "Whether or not Player power levels should be displayed below " +
|
||||
"their username (above their 3d model in the world)" +
|
||||
"\nAlthough it doesn't seem related to scoreboards, displaying a power level for a Player is done" +
|
||||
"through the use of scoreboards." +
|
||||
"\nThis is off by default because a lot of Plugins for Minecraft make use of editing" +
|
||||
" a players \"nameplate\" and that can cause compatibility issues" +
|
||||
"\nDefault value: "+ POWER_LEVEL_DISPLAY_DEFAULT)
|
||||
private boolean powerLevelTags = POWER_LEVEL_DISPLAY_DEFAULT;
|
||||
|
||||
@Setting(value = "Show_Stats_Scoreboard_On_Player_Login", comment = "Shows the player the /mcstats scoreboard" +
|
||||
" display after they login." +
|
||||
"\nDefault value: "+ SHOW_PLAYER_STATS_SCOREBOARD_AFTER_LOGIN_DEFAULT)
|
||||
private boolean showStatsAfterLogin = SHOW_PLAYER_STATS_SCOREBOARD_AFTER_LOGIN_DEFAULT;
|
||||
|
||||
@Setting(value = "Show_Scoreboard_Tips_Only_This_Many_Times", comment = "This determines how many times players are" +
|
||||
" given tips about how to use the scoreboard system before they are never tipped again." +
|
||||
"\nPlayers are given tips once per login session." +
|
||||
"\nDefault value: "+ SHOW_TIPS_LIMIT_DEFAULT)
|
||||
private int tipsAmount = SHOW_TIPS_LIMIT_DEFAULT;
|
||||
|
||||
@Setting(value ="Use_Rainbow_Styling_For_Skill_Names", comment = "If true, skills names will use rainbow style" +
|
||||
" colorings instead of having the same color" +
|
||||
"\nDefault value: "+ USE_RAINBOW_SKILL_COLORING_DEFAULT)
|
||||
private boolean useRainbows = USE_RAINBOW_SKILL_COLORING_DEFAULT;
|
||||
|
||||
@Setting(value = "Use_Super_Ability_Name_Instead_Of_Generic_Name",
|
||||
comment = "If true, scoreboards displaying super ability cooldowns will use the super abilities name " +
|
||||
"instead of using a generic word from the locale, which by default in the locale is defined as " +
|
||||
"\"Ability\". The locale key for this entry is - Scoreboard.Misc.Ability " +
|
||||
"\nExample: If true Tree Feller will be shown instead of Super Ability with default en_us locale entries" +
|
||||
"\nDefault value: "+ USE_SUPER_ABILITY_NAME_INSTEAD_OF_GENERIC)
|
||||
private boolean useAbilityNameInsteadOfGeneric = USE_SUPER_ABILITY_NAME_INSTEAD_OF_GENERIC;
|
||||
|
||||
@Setting(value = "Scoreboard_Specific_Settings", comment = "Settings for individual scoreboard displays")
|
||||
private ConfigSectionScoreboardTypes configSectionScoreboardTypes = new ConfigSectionScoreboardTypes();
|
||||
|
||||
/*
|
||||
* GETTER BOILERPLATE
|
||||
*/
|
||||
|
||||
public boolean getScoreboardsEnabled() {
|
||||
return useScoreboards;
|
||||
}
|
||||
|
||||
public boolean getPowerLevelTagsEnabled() {
|
||||
return powerLevelTags;
|
||||
}
|
||||
|
||||
public boolean getShowStatsAfterLogin() {
|
||||
return showStatsAfterLogin;
|
||||
}
|
||||
|
||||
public int getTipsAmount() {
|
||||
return tipsAmount;
|
||||
}
|
||||
|
||||
public boolean getUseRainbowSkillStyling() {
|
||||
return useRainbows;
|
||||
}
|
||||
|
||||
public boolean getUseAbilityNamesOverGenerics() {
|
||||
return useAbilityNameInsteadOfGeneric;
|
||||
}
|
||||
|
||||
public ConfigSectionScoreboardTypes getConfigSectionScoreboardTypes() {
|
||||
return configSectionScoreboardTypes;
|
||||
}
|
||||
|
||||
/*
|
||||
* HELPER METHODS
|
||||
*/
|
||||
|
||||
public boolean getScoreboardTypeEnabled(ScoreboardManager.SidebarType sidebarType)
|
||||
{
|
||||
switch(sidebarType)
|
||||
{
|
||||
case TOP_BOARD:
|
||||
return getConfigSectionScoreboardTypes().getConfigSectionTopBoard().isUseThisBoard();
|
||||
case RANK_BOARD:
|
||||
return getConfigSectionScoreboardTypes().getConfigSectionRankBoard().isUseThisBoard();
|
||||
case STATS_BOARD:
|
||||
return getConfigSectionScoreboardTypes().getConfigSectionStatsBoard().isUseThisBoard();
|
||||
case COOLDOWNS_BOARD:
|
||||
return getConfigSectionScoreboardTypes().getConfigSectionCooldownBoard().isUseThisBoard();
|
||||
case SKILL_BOARD:
|
||||
return getConfigSectionScoreboardTypes().getConfigSectionSkillBoard().isUseThisBoard();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getScoreboardTypePrintToChatEnabled(ScoreboardManager.SidebarType sidebarType)
|
||||
{
|
||||
switch(sidebarType)
|
||||
{
|
||||
case TOP_BOARD:
|
||||
return getConfigSectionScoreboardTypes().getConfigSectionTopBoard().isPrintToChat();
|
||||
case RANK_BOARD:
|
||||
return getConfigSectionScoreboardTypes().getConfigSectionRankBoard().isPrintToChat();
|
||||
case STATS_BOARD:
|
||||
return getConfigSectionScoreboardTypes().getConfigSectionStatsBoard().isPrintToChat();
|
||||
case COOLDOWNS_BOARD:
|
||||
return getConfigSectionScoreboardTypes().getConfigSectionCooldownBoard().isPrintToChat();
|
||||
//NOTE: SKILL_BOARD does not have a setting for this because it is always printed to chat
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public int getScoreboardTypeDisplayTime(ScoreboardManager.SidebarType sidebarType)
|
||||
{
|
||||
switch(sidebarType)
|
||||
{
|
||||
case TOP_BOARD:
|
||||
return getConfigSectionScoreboardTypes().getConfigSectionTopBoard().getDisplayTimeInSeconds();
|
||||
case RANK_BOARD:
|
||||
return getConfigSectionScoreboardTypes().getConfigSectionRankBoard().getDisplayTimeInSeconds();
|
||||
case STATS_BOARD:
|
||||
return getConfigSectionScoreboardTypes().getConfigSectionStatsBoard().getDisplayTimeInSeconds();
|
||||
case COOLDOWNS_BOARD:
|
||||
return getConfigSectionScoreboardTypes().getConfigSectionCooldownBoard().getDisplayTimeInSeconds();
|
||||
case SKILL_BOARD:
|
||||
return getConfigSectionScoreboardTypes().getConfigSectionSkillBoard().getDisplayTimeInSeconds();
|
||||
default:
|
||||
return 20;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.gmail.nossr50.config.hocon.scoreboard;
|
||||
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigSectionCooldownBoard {
|
||||
|
||||
/* DEFAULT VALUES*/
|
||||
private static final boolean PRINT_TO_CHAT_DEFAULT = true;
|
||||
private static final boolean USE_THIS_SCOREBOARD_DEFAULT = true;
|
||||
private static final int DISPLAY_TIME_SECONDS_DEFAULT = 40;
|
||||
|
||||
/*
|
||||
* CONFIG NODES
|
||||
*/
|
||||
|
||||
@Setting(value = "Show_Command_Output_In_Chat",
|
||||
comment = "Should the commands normal chat output be shown in chat?" +
|
||||
"\nIf you feel that the scoreboard does a good enough job at conveying the information, you can set this to false." +
|
||||
"\nIf you'd like to show the chat anyways, turn this to true, the scoreboard will still be shown if its enabled." +
|
||||
"\nDefault value: "+PRINT_TO_CHAT_DEFAULT)
|
||||
private boolean printToChat = PRINT_TO_CHAT_DEFAULT;
|
||||
|
||||
@Setting(value = "Show_Scoreboard",
|
||||
comment = "Whether or not you wish to enable the display of this scoreboard." +
|
||||
"\nScoreboards are shown when the associated command is executed from the player." +
|
||||
"\nThis setting will only work if \"Use_Scoreboards\" is set to true, which is found elsewhere in this configuration file." +
|
||||
"\nDefault value: "+USE_THIS_SCOREBOARD_DEFAULT)
|
||||
private boolean useThisBoard = USE_THIS_SCOREBOARD_DEFAULT;
|
||||
|
||||
@Setting(value = "Display_Time_In_Seconds",
|
||||
comment = "How long to keep the scoreboard on a players screen after it is first shown." +
|
||||
"\nThis setting is not related to the command that keeps scoreboards on screen." +
|
||||
"\nDefault value: "+DISPLAY_TIME_SECONDS_DEFAULT)
|
||||
private int displayTimeInSeconds = DISPLAY_TIME_SECONDS_DEFAULT;
|
||||
|
||||
/*
|
||||
* GETTER BOILERPLATE
|
||||
*/
|
||||
|
||||
public boolean isPrintToChat() {
|
||||
return printToChat;
|
||||
}
|
||||
|
||||
public boolean isUseThisBoard() {
|
||||
return useThisBoard;
|
||||
}
|
||||
|
||||
public int getDisplayTimeInSeconds() {
|
||||
return displayTimeInSeconds;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.gmail.nossr50.config.hocon.scoreboard;
|
||||
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigSectionInspectBoard {
|
||||
|
||||
/* DEFAULT VALUES*/
|
||||
private static final boolean PRINT_TO_CHAT_DEFAULT = false;
|
||||
private static final boolean USE_THIS_SCOREBOARD_DEFAULT = true;
|
||||
private static final int DISPLAY_TIME_SECONDS_DEFAULT = 20;
|
||||
|
||||
/*
|
||||
* CONFIG NODES
|
||||
*/
|
||||
|
||||
@Setting(value = "Show_Command_Output_In_Chat",
|
||||
comment = "Should the commands normal chat output be shown in chat?" +
|
||||
"\nIf you feel that the scoreboard does a good enough job at conveying the information, you can set this to false." +
|
||||
"\nIf you'd like to show the chat anyways, turn this to true, the scoreboard will still be shown if its enabled." +
|
||||
"\nDefault value: "+PRINT_TO_CHAT_DEFAULT)
|
||||
private boolean printToChat = PRINT_TO_CHAT_DEFAULT;
|
||||
|
||||
@Setting(value = "Show_Scoreboard",
|
||||
comment = "Whether or not you wish to enable the display of this scoreboard." +
|
||||
"\nScoreboards are shown when the associated command is executed from the player." +
|
||||
"\nThis setting will only work if \"Use_Scoreboards\" is set to true, which is found elsewhere in this configuration file." +
|
||||
"\nDefault value: "+USE_THIS_SCOREBOARD_DEFAULT)
|
||||
private boolean useThisBoard = USE_THIS_SCOREBOARD_DEFAULT;
|
||||
|
||||
@Setting(value = "Display_Time_In_Seconds",
|
||||
comment = "How long to keep the scoreboard on a players screen after it is first shown." +
|
||||
"\nThis setting is not related to the command that keeps scoreboards on screen." +
|
||||
"\nDefault value: "+DISPLAY_TIME_SECONDS_DEFAULT)
|
||||
private int displayTimeInSeconds = DISPLAY_TIME_SECONDS_DEFAULT;
|
||||
|
||||
/*
|
||||
* GETTER BOILERPLATE
|
||||
*/
|
||||
|
||||
public boolean isPrintToChat() {
|
||||
return printToChat;
|
||||
}
|
||||
|
||||
public boolean isUseThisBoard() {
|
||||
return useThisBoard;
|
||||
}
|
||||
|
||||
public int getDisplayTimeInSeconds() {
|
||||
return displayTimeInSeconds;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.gmail.nossr50.config.hocon.scoreboard;
|
||||
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigSectionRankBoard {
|
||||
|
||||
/* DEFAULT VALUES*/
|
||||
private static final boolean PRINT_TO_CHAT_DEFAULT = false;
|
||||
private static final boolean USE_THIS_SCOREBOARD_DEFAULT = true;
|
||||
private static final int DISPLAY_TIME_SECONDS_DEFAULT = 15;
|
||||
|
||||
/*
|
||||
* CONFIG NODES
|
||||
*/
|
||||
|
||||
@Setting(value = "Show_Command_Output_In_Chat",
|
||||
comment = "Should the commands normal chat output be shown in chat?" +
|
||||
"\nIf you feel that the scoreboard does a good enough job at conveying the information, you can set this to false." +
|
||||
"\nIf you'd like to show the chat anyways, turn this to true, the scoreboard will still be shown if its enabled." +
|
||||
"\nDefault value: "+PRINT_TO_CHAT_DEFAULT)
|
||||
private boolean printToChat = PRINT_TO_CHAT_DEFAULT;
|
||||
|
||||
@Setting(value = "Show_Scoreboard",
|
||||
comment = "Whether or not you wish to enable the display of this scoreboard." +
|
||||
"\nScoreboards are shown when the associated command is executed from the player." +
|
||||
"\nThis setting will only work if \"Use_Scoreboards\" is set to true, which is found elsewhere in this configuration file." +
|
||||
"\nDefault value: "+USE_THIS_SCOREBOARD_DEFAULT)
|
||||
private boolean useThisBoard = USE_THIS_SCOREBOARD_DEFAULT;
|
||||
|
||||
@Setting(value = "Display_Time_In_Seconds",
|
||||
comment = "How long to keep the scoreboard on a players screen after it is first shown." +
|
||||
"\nThis setting is not related to the command that keeps scoreboards on screen." +
|
||||
"\nDefault value: "+DISPLAY_TIME_SECONDS_DEFAULT)
|
||||
private int displayTimeInSeconds = DISPLAY_TIME_SECONDS_DEFAULT;
|
||||
|
||||
/*
|
||||
* GETTER BOILERPLATE
|
||||
*/
|
||||
|
||||
public boolean isPrintToChat() {
|
||||
return printToChat;
|
||||
}
|
||||
|
||||
public boolean isUseThisBoard() {
|
||||
return useThisBoard;
|
||||
}
|
||||
|
||||
public int getDisplayTimeInSeconds() {
|
||||
return displayTimeInSeconds;
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.gmail.nossr50.config.hocon.scoreboard;
|
||||
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigSectionScoreboardTypes {
|
||||
|
||||
/*
|
||||
* CONFIG NODES
|
||||
*/
|
||||
|
||||
@Setting(value = "Rank_Scoreboard", comment = "Settings for /mcrank")
|
||||
private ConfigSectionRankBoard configSectionRankBoard = new ConfigSectionRankBoard();
|
||||
|
||||
@Setting(value = "Top_Scoreboard", comment = "Settings for /mctop")
|
||||
private ConfigSectionTopBoard configSectionTopBoard = new ConfigSectionTopBoard();
|
||||
|
||||
@Setting(value = "Stats_Scoreboard", comment = "Settings for /mcstats")
|
||||
private ConfigSectionStatsBoard configSectionStatsBoard = new ConfigSectionStatsBoard();
|
||||
|
||||
@Setting(value = "Inspect_Scoreboard", comment = "Settings for /inspect")
|
||||
private ConfigSectionInspectBoard configSectionInspectBoard = new ConfigSectionInspectBoard();
|
||||
|
||||
@Setting(value = "Cooldown_Scoreboard", comment = "Settings for /mccooldown")
|
||||
private ConfigSectionCooldownBoard configSectionCooldownBoard = new ConfigSectionCooldownBoard();
|
||||
|
||||
@Setting(value = "Skill_Scoreboard_Settings",
|
||||
comment = "Settings for /<skillname> (e.g. /mining, /unarmed)" +
|
||||
"\nNo \"print\" option is given here; the information will always be displayed in chat." +
|
||||
"\nThe functionality of this scoreboard overlaps heavily with the new XP bars," +
|
||||
" so these scoreboards are disabled by default")
|
||||
private ConfigSectionSkillBoard configSectionSkillBoard = new ConfigSectionSkillBoard();
|
||||
|
||||
/*
|
||||
* GETTER BOILERPLATE
|
||||
*/
|
||||
|
||||
public ConfigSectionRankBoard getConfigSectionRankBoard() {
|
||||
return configSectionRankBoard;
|
||||
}
|
||||
|
||||
public ConfigSectionTopBoard getConfigSectionTopBoard() {
|
||||
return configSectionTopBoard;
|
||||
}
|
||||
|
||||
public ConfigSectionStatsBoard getConfigSectionStatsBoard() {
|
||||
return configSectionStatsBoard;
|
||||
}
|
||||
|
||||
public ConfigSectionInspectBoard getConfigSectionInspectBoard() {
|
||||
return configSectionInspectBoard;
|
||||
}
|
||||
|
||||
public ConfigSectionCooldownBoard getConfigSectionCooldownBoard() {
|
||||
return configSectionCooldownBoard;
|
||||
}
|
||||
|
||||
public ConfigSectionSkillBoard getConfigSectionSkillBoard() {
|
||||
return configSectionSkillBoard;
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.gmail.nossr50.config.hocon.scoreboard;
|
||||
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigSectionSkillBoard {
|
||||
|
||||
/* DEFAULT VALUES*/
|
||||
private static final boolean USE_THIS_SCOREBOARD_DEFAULT = true;
|
||||
private static final int DISPLAY_TIME_SECONDS_DEFAULT = 30;
|
||||
private static final boolean SHOW_BOARD_ON_PLAYER_LEVELUP = true;
|
||||
private static final int SHOW_BOARD_ON_LEVELUP_TIME = 5;
|
||||
|
||||
/*
|
||||
* CONFIG NODES
|
||||
*/
|
||||
|
||||
@Setting(value = "Show_Scoreboard",
|
||||
comment = "Whether or not you wish to enable the display of this scoreboard." +
|
||||
"\nScoreboards are shown when the associated command is executed from the player." +
|
||||
"\nThis setting will only work if \"Use_Scoreboards\" is set to true," +
|
||||
" which is found elsewhere in this configuration file." +
|
||||
"\nDefault value: "+USE_THIS_SCOREBOARD_DEFAULT)
|
||||
private boolean useThisBoard = USE_THIS_SCOREBOARD_DEFAULT;
|
||||
|
||||
@Setting(value = "Display_Time_In_Seconds",
|
||||
comment = "How long to keep the scoreboard on a players screen after it is first shown." +
|
||||
"\nThis setting is not related to the command that keeps scoreboards on screen." +
|
||||
"\nDefault value: "+DISPLAY_TIME_SECONDS_DEFAULT)
|
||||
private int displayTimeInSeconds = DISPLAY_TIME_SECONDS_DEFAULT;
|
||||
|
||||
@Setting(value = "Show_Board_On_Player_Level_Up",
|
||||
comment = "Show a skill scoreboard when the player levels up in that skill" +
|
||||
"\nDefault value: "+SHOW_BOARD_ON_PLAYER_LEVELUP)
|
||||
private boolean showBoardOnPlayerLevelUp = SHOW_BOARD_ON_PLAYER_LEVELUP;
|
||||
|
||||
@Setting(value = "Level_Up_Display_Time", comment = "How long to show a skill scoreboard when a player levels up?" +
|
||||
"\nIs only shown if Show_Board_On_Player_Level_Up is true" +
|
||||
"\nDefault value: "+SHOW_BOARD_ON_LEVELUP_TIME)
|
||||
private int showBoardOnPlayerLevelUpTime = SHOW_BOARD_ON_LEVELUP_TIME;
|
||||
|
||||
/*
|
||||
* GETTER BOILERPLATE
|
||||
*/
|
||||
|
||||
public boolean isUseThisBoard() {
|
||||
return useThisBoard;
|
||||
}
|
||||
|
||||
public int getDisplayTimeInSeconds() {
|
||||
return displayTimeInSeconds;
|
||||
}
|
||||
|
||||
public boolean getShowBoardOnPlayerLevelUp() {
|
||||
return showBoardOnPlayerLevelUp;
|
||||
}
|
||||
|
||||
public int getShowBoardOnPlayerLevelUpTime() {
|
||||
return showBoardOnPlayerLevelUpTime;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.gmail.nossr50.config.hocon.scoreboard;
|
||||
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigSectionStatsBoard {
|
||||
|
||||
/* DEFAULT VALUES*/
|
||||
private static final boolean PRINT_TO_CHAT_DEFAULT = true;
|
||||
private static final boolean USE_THIS_SCOREBOARD_DEFAULT = true;
|
||||
private static final int DISPLAY_TIME_SECONDS_DEFAULT = 15;
|
||||
|
||||
/*
|
||||
* CONFIG NODES
|
||||
*/
|
||||
|
||||
@Setting(value = "Show_Command_Output_In_Chat",
|
||||
comment = "Should the commands normal chat output be shown in chat?" +
|
||||
"\nIf you feel that the scoreboard does a good enough job at conveying the information, you can set this to false." +
|
||||
"\nIf you'd like to show the chat anyways, turn this to true, the scoreboard will still be shown if its enabled." +
|
||||
"\nDefault value: "+PRINT_TO_CHAT_DEFAULT)
|
||||
private boolean printToChat = PRINT_TO_CHAT_DEFAULT;
|
||||
|
||||
@Setting(value = "Show_Scoreboard",
|
||||
comment = "Whether or not you wish to enable the display of this scoreboard." +
|
||||
"\nScoreboards are shown when the associated command is executed from the player." +
|
||||
"\nThis setting will only work if \"Use_Scoreboards\" is set to true, which is found elsewhere in this configuration file." +
|
||||
"\nDefault value: "+USE_THIS_SCOREBOARD_DEFAULT)
|
||||
private boolean useThisBoard = USE_THIS_SCOREBOARD_DEFAULT;
|
||||
|
||||
@Setting(value = "Display_Time_In_Seconds",
|
||||
comment = "How long to keep the scoreboard on a players screen after it is first shown." +
|
||||
"\nThis setting is not related to the command that keeps scoreboards on screen." +
|
||||
"\nDefault value: "+DISPLAY_TIME_SECONDS_DEFAULT)
|
||||
private int displayTimeInSeconds = DISPLAY_TIME_SECONDS_DEFAULT;
|
||||
|
||||
/*
|
||||
* GETTER BOILERPLATE
|
||||
*/
|
||||
|
||||
public boolean isPrintToChat() {
|
||||
return printToChat;
|
||||
}
|
||||
|
||||
public boolean isUseThisBoard() {
|
||||
return useThisBoard;
|
||||
}
|
||||
|
||||
public int getDisplayTimeInSeconds() {
|
||||
return displayTimeInSeconds;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.gmail.nossr50.config.hocon.scoreboard;
|
||||
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigSectionTopBoard {
|
||||
|
||||
/* DEFAULT VALUES*/
|
||||
private static final boolean PRINT_TO_CHAT_DEFAULT = true;
|
||||
private static final boolean USE_THIS_SCOREBOARD_DEFAULT = true;
|
||||
private static final int DISPLAY_TIME_SECONDS_DEFAULT = 15;
|
||||
|
||||
/*
|
||||
* CONFIG NODES
|
||||
*/
|
||||
|
||||
@Setting(value = "Show_Command_Output_In_Chat",
|
||||
comment = "Should the commands normal chat output be shown in chat?" +
|
||||
"\nIf you feel that the scoreboard does a good enough job at conveying the information, you can set this to false." +
|
||||
"\nIf you'd like to show the chat anyways, turn this to true, the scoreboard will still be shown if its enabled." +
|
||||
"\nDefault value: "+PRINT_TO_CHAT_DEFAULT)
|
||||
private boolean printToChat = PRINT_TO_CHAT_DEFAULT;
|
||||
|
||||
@Setting(value = "Show_Scoreboard",
|
||||
comment = "Whether or not you wish to enable the display of this scoreboard." +
|
||||
"\nScoreboards are shown when the associated command is executed from the player." +
|
||||
"\nThis setting will only work if \"Use_Scoreboards\" is set to true, which is found elsewhere in this configuration file." +
|
||||
"\nDefault value: "+USE_THIS_SCOREBOARD_DEFAULT)
|
||||
private boolean useThisBoard = USE_THIS_SCOREBOARD_DEFAULT;
|
||||
|
||||
@Setting(value = "Display_Time_In_Seconds",
|
||||
comment = "How long to keep the scoreboard on a players screen after it is first shown." +
|
||||
"\nThis setting is not related to the command that keeps scoreboards on screen." +
|
||||
"\nDefault value: "+DISPLAY_TIME_SECONDS_DEFAULT)
|
||||
private int displayTimeInSeconds = DISPLAY_TIME_SECONDS_DEFAULT;
|
||||
|
||||
/*
|
||||
* GETTER BOILERPLATE
|
||||
*/
|
||||
|
||||
public boolean isPrintToChat() {
|
||||
return printToChat;
|
||||
}
|
||||
|
||||
public boolean isUseThisBoard() {
|
||||
return useThisBoard;
|
||||
}
|
||||
|
||||
public int getDisplayTimeInSeconds() {
|
||||
return displayTimeInSeconds;
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
package com.gmail.nossr50.config.hocon;
|
||||
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class Scoreboard {
|
||||
}
|
Reference in New Issue
Block a user