mcMMO/src/main/java/com/gmail/nossr50/config/MainConfig.java

1190 lines
46 KiB
Java
Raw Normal View History

2019-02-16 16:09:48 -08:00
package com.gmail.nossr50.config;
import com.gmail.nossr50.database.SQLDatabaseManager;
import com.gmail.nossr50.datatypes.MobHealthbarType;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.StringUtils;
import org.bukkit.Material;
2019-02-18 12:16:10 -08:00
import org.bukkit.block.data.BlockData;
2019-02-16 16:09:48 -08:00
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.EntityType;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
public class MainConfig extends ConfigValidated {
2019-02-18 13:56:33 -08:00
public static final String METRICS = "Metrics";
public static final String BSTATS = "bstats";
public static final String GENERAL = "General";
public static final String RETRO_MODE = "RetroMode";
public static final String ENABLED = "Enabled";
public static final String LOCALE = "Locale";
public static final String EN_US = "en_us";
public static final String MOTD = "MOTD_";
public static final String SHOW_PROFILE_LOADED = "Show_Profile_Loaded";
public static final String DONATE_MESSAGE = "Donate_Message";
public static final String MCMMO = "mcmmo";
public static final String DATABASE_PREFIX = MCMMO + "_";
public static final String COMMANDS = "Commands";
public static final String SAVE_INTERVAL = "Save_Interval";
public static final String STATS = "Stats";
public static final String STATS_TRACKING = STATS + "_Tracking";
public static final String UPDATE_CHECK = "Update_Check";
public static final String PREFER_BETA = "Prefer_Beta";
public static final String VERBOSE_LOGGING = "Verbose_Logging";
public static final String PARTYCHAT = "partychat";
public static final String CHAT_PREFIX_FORMAT = "Chat_Prefix_Format";
public static final String NAME = "Name";
public static final String GOLD_LEADER_NAME = "Gold_Leader_" + NAME;
public static final String USE_DISPLAY_NAMES = "Use_Display_" + NAME + "s";
public static final String ALLY = "_Ally";
public static final String ADMINCHAT = "adminchat";
public static final String GENERIC = "Generic";
public static final String MATCH_OFFLINE_PLAYERS = "Match_OfflinePlayers";
public static final String DATABASE = "Database";
public static final String COOLDOWN = "Cooldown";
public static final String PLAYER_COOLDOWN = "Player_" + COOLDOWN;
public static final String LEVEL_UP = "LevelUp_";
public static final String SOUND = "Sound";
public static final String LEVEL_UP_SOUNDS = LEVEL_UP + SOUNDS;
public static final String REFRESH_CHUNKS = "Refresh_Chunks";
public static final String MOB_HEALTHBAR = "Mob_Healthbar";
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 USE_SCOREBOARDS = "UseScoreboards";
public static final String POWER = "Power_";
public static final String POWER_LEVEL_TAGS = POWER + "Level_Tags";
public static final String KEEP = "Keep";
public static final String ALLOW_KEEP = "Allow_" + KEEP;
public static final String TIPS_AMOUNT = "Tips_Amount";
public static final String SHOW_STATS_AFTER_LOGIN = "Show_" + STATS + "_After_Login";
public static final String RAINBOWS = "Rainbows";
public static final String ABILITY_NAMES = "Ability_" + NAME + "s";
public static final String TYPES = "Types";
public static final String RANK = "Rank";
public static final String PRINT = "Print";
public static final String BOARD = "Board";
public static final String TOP = "Top";
public static final String INSPECT = "Inspect";
public static final String SKILL = "Skill";
public static final String TIME = "Time";
public static final String PURGING = "_Purging";
public static final String PURGE_INTERVAL = "Purge_Interval";
public static final String OLD_USER_CUTOFF = "Old_User_Cutoff";
public static final String BACKUPS = "Backups";
public static final String KEEP_LAST_24_HOURS = KEEP + ".Last_24_Hours";
public static final String DAILY_LAST_WEEK = "Daily_Last_Week";
public static final String WEEKLY_PAST_MONTHS = "Weekly_Past_Months";
public static final String MY_SQL = "MySQL";
public static final String TABLE_PREFIX = "TablePrefix";
public static final String USER_NAME = "User_" + NAME;
public static final String SERVER = "Server";
public static final String PORT = "Port";
public static final String ADDRESS = "Address";
public static final String LOCALHOST = "localhost";
public static final String USER_PASSWORD = "User_Password";
public static final String MAX_CONNECTIONS = "MaxConnections";
public static final String MAX_POOL_SIZE = "MaxPoolSize";
public static final String SSL = "SSL";
public static final String HARDCORE = "Hardcore";
public static final String DEATH_STAT_LOSS = "Death_Stat_Loss";
public static final String PENALTY_PERCENTAGE = "Penalty_Percentage";
public static final String LEVEL_THRESHOLD = "Level_Threshold";
public static final String VAMPIRISM = "Vampirism";
public static final String LEECH_PERCENTAGE = "Leech_Percentage";
public static final String ITEMS = "Items";
public static final String CHIMAERA_WING = "Chimaera_Wing";
public static final String USE_COST = "Use_Cost";
public static final String RECIPE_COST = "Recipe_Cost";
public static final String ITEM = "Item_";
public static final String FEATHER = "Feather";
public static final String PREVENT = "Prevent_";
public static final String PREVENT_USE_UNDERGROUND = PREVENT + "Use_Underground";
public static final String USE_BED_SPAWN = "Use_Bed_Spawn";
public static final String WARMUP = "Warmup";
public static final String RECENTLY_HURT = "RecentlyHurt_";
public static final String PARTICLES = "Particles";
public static final String ACTIVATION = "Activation";
public static final String ABILITY_ACTIVATION = "Ability_" + ACTIVATION;
public static final String ABILITY_DEACTIVATION = "Ability_Deactivation";
public static final String BLEED = "Bleed";
public static final String DODGE = "Dodge";
public static final String FLUX = "Flux";
public static final String GREATER_IMPACT = "Greater_Impact";
public static final String CALL_OF_THE_WILD = "Call_of_the_Wild";
public static final String TIER = "Tier";
public static final String LARGE_FIREWORKS = "LargeFireworks";
public static final String PARTY = "Party";
public static final String FRIENDLY_FIRE = "FriendlyFire";
public static final String MAX_SIZE = "MaxSize";
public static final String AUTO_KICK_INTERVAL = "AutoKick_Interval";
public static final String OLD_PARTY_MEMBER_CUTOFF = "Old_Party_Member_Cutoff";
public static final String SHARING = "Sharing";
public static final String SHARING_EXP_SHARE_BONUS_BASE = SHARING + ".ExpShare_bonus_base";
public static final String EXP_SHARE_BONUS_INCREASE = "ExpShare_bonus_increase";
public static final String EXP_SHARE_BONUS_CAP = "ExpShare_bonus_cap";
public static final String RANGE = "Range";
public static final String LEVELING = "Leveling";
public static final String LEVEL_CAP = "Level_Cap";
public static final String XP_CURVE_MODIFIER = "Xp_Curve_Modifier";
public static final String NEAR_MEMBERS_NEEDED = "Near_Members_Needed";
public static final String INFORM_ALL_PARTY_MEMBERS_ON_LEVEL_UP = "Inform_All_Party_Members_On_LevelUp";
public static final String UNLOCK_LEVEL = "_UnlockLevel";
public static final String PTP = "ptp";
public static final String ACCEPT_REQUIRED = "Accept_Required";
public static final String REQUEST_TIMEOUT = "Request_Timeout";
public static final String WORLD_BASED_PERMISSIONS = "World_Based_Permissions";
public static final String INSPECT1 = "inspect";
public static final String MAX_DISTANCE = "Max_Distance";
public static final String SKILLS = "Skills";
public static final String URL_LINKS = "URL_Links";
public static final String ABILITIES = "Abilities";
public static final String MESSAGES = "Messages";
public static final String ONLY_ACTIVATE_WHEN_SNEAKING = "Only_Activate_When_Sneaking";
public static final String LEVEL_GATE_ABILITIES = "Level_Gate_Abilities";
public static final String COOLDOWNS = "Cooldowns";
public static final String MAX_SECONDS = "Max_Seconds";
public static final String TOOLS = "Tools";
public static final String DURABILITY_LOSS = "Durability_Loss";
public static final String LIMITS = "Limits";
public static final String TREE_FELLER = "Tree_Feller_";
public static final String TREE_FELLER_THRESHOLD = TREE_FELLER + "Threshold";
public static final String DOUBLE_DROPS = "Double_Drops";
public static final String AXES = "Axes";
public static final String TRUNCATE = "Truncate";
public static final String FOR_PVP = "_For_PVP";
public static final String FOR_PVE = "_For_PVE";
public static final String ACROBATICS = "Acrobatics";
public static final String PREVENT_AFK = PREVENT + "AFK_";
public static final String WOODCUTTING = "Woodcutting";
public static final String SOUNDS = "Sounds";
public static final String MAX_TRIES_AT_SAME_LOCATION = "Max_Tries_At_Same_Location";
public static final String HERBALISM = "Herbalism";
public static final String TAMING = "Taming";
public static final String CALL_OF_THE_WILD1 = "Call_Of_The_Wild";
public static final String SUMMON_AMOUNT = "Summon_Amount";
public static final String SUMMON_LENGTH = "Summon_Length";
public static final String SUMMON_MAX_AMOUNT = "Summon_Max_Amount";
public static final String AMOUNT = "Amount";
public static final String MATERIAL = "Material";
public static final String REPAIR = "Repair";
public static final String CONFIRM_REQUIRED = "Confirm_Required";
public static final String ANVIL = "Anvil_";
public static final String ANVIL_MATERIAL = ANVIL + "Material";
public static final String IRON_BLOCK = "IRON_BLOCK";
public static final String ANVIL_USE = ANVIL + "Use_";
public static final String ANVIL_PLACED = ANVIL + "Placed_";
public static final String SALVAGE = "Salvage";
public static final String UNARMED = "Unarmed";
public static final String BLOCK_CRACKER = "Block_Cracker";
public static final String SMOOTH_BRICK_TO_CRACKED_BRICK = "SmoothBrick_To_CrackedBrick";
public static final String PICKUP_DISABLED_FULL_INVENTORY = "Pickup_Disabled_Full_Inventory";
public static final String AS = "_As_";
public static final String MINING = "Mining";
public static final String DETONATOR = "Detonator_";
public static final String FLINT_AND_STEEL = "FLINT_AND_STEEL";
public static final String FISHING = "Fishing";
public static final String LURE_MODIFIER = "Lure_Modifier";
public static final String EXTRA_FISH = "Extra_Fish";
public static final String OVERRIDE_VANILLA_TREASURES = "Override_Vanilla_Treasures";
public static final String DROPS = "Drops_";
public static final String ALCHEMY = "Alchemy";
public static final String PREVENT_HOPPER_TRANSFER_BOTTLES = PREVENT + "Hopper_Transfer_Bottles";
public static final String PREVENT_HOPPER_TRANSFER_INGREDIENTS = PREVENT + "Hopper_Transfer_Ingredients";
public static final String FOR_HOPPERS = "_for_Hoppers";
public static final String XP_AFTER_TELEPORT = "XP_After_Teleport_";
public static final String LIGHTNING = "_Lightning";
public static final String GOLD_BLOCK = "GOLD_BLOCK";
2019-02-17 11:32:53 -08:00
public MainConfig() {
2019-02-16 16:09:48 -08:00
//super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "config.yml", true);
super(mcMMO.p.getDataFolder().getAbsoluteFile(), "config.yml", true);
}
2019-02-17 11:32:53 -08:00
/**
* This grabs an instance of this config class from the Config Manager
* This method is deprecated and will be removed in the future
* @see mcMMO#getConfigManager()
* @return the instance of this config
* @deprecated Please use mcMMO.getConfigManager() to grab a specific config instead
*/
@Deprecated
2019-02-16 16:09:48 -08:00
public static MainConfig getInstance() {
2019-02-17 11:32:53 -08:00
return mcMMO.getConfigManager().getMainConfig();
2019-02-16 16:09:48 -08:00
}
@Override
public void unload() {
2019-02-17 11:32:53 -08:00
//do nothing
2019-02-16 16:09:48 -08:00
}
/**
* The version of this config
*
* @return
*/
@Override
public double getConfigVersion() {
return 1;
}
@Override
public List<String> validateKeys() {
// Validate all the settings!
List<String> reason = new ArrayList<String>();
/* General Settings */
if (getSaveInterval() <= 0) {
2019-02-18 13:56:33 -08:00
reason.add(GENERAL + "." + SAVE_INTERVAL + " should be greater than 0!");
2019-02-16 16:09:48 -08:00
}
/* MySQL Settings */
for (SQLDatabaseManager.PoolIdentifier identifier : SQLDatabaseManager.PoolIdentifier.values()) {
if (getMySQLMaxConnections(identifier) <= 0) {
2019-02-18 13:56:33 -08:00
reason.add(MY_SQL + "." + DATABASE + "." + MAX_CONNECTIONS + "." + StringUtils.getCapitalized(identifier.toString()) + " should be greater than 0!");
2019-02-16 16:09:48 -08:00
}
if (getMySQLMaxPoolSize(identifier) <= 0) {
2019-02-18 13:56:33 -08:00
reason.add(MY_SQL + "." + DATABASE + "." + MAX_POOL_SIZE + "." + StringUtils.getCapitalized(identifier.toString()) + " should be greater than 0!");
2019-02-16 16:09:48 -08:00
}
}
/* Mob Healthbar */
if (getMobHealthbarTime() == 0) {
2019-02-18 13:56:33 -08:00
reason.add(MOB_HEALTHBAR + "." + DISPLAY_TIME + " cannot be 0! Set to -1 to disable or set a valid value.");
2019-02-16 16:09:48 -08:00
}
/* Scoreboards */
/*if (getRankScoreboardTime() != -1 && getRankScoreboardTime() <= 0) {
reason.add("Scoreboard.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!");
}
if (getTopScoreboardTime() != -1 && getTopScoreboardTime() <= 0) {
reason.add("Scoreboard.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!");
}
if (getSkillScoreboardTime() != -1 && getSkillScoreboardTime() <= 0) {
reason.add("Scoreboard.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!");
}
if (!(getRankUseChat() || getRankUseBoard())) {
reason.add("Either Board or Print in Scoreboard.Types.Rank must be true!");
}
if (!(getTopUseChat() || getTopUseBoard())) {
reason.add("Either Board or Print in Scoreboard.Types.Top must be true!");
}
if (!(getStatsUseChat() || getStatsUseBoard())) {
reason.add("Either Board or Print in Scoreboard.Types.Stats must be true!");
}
if (!(getInspectUseChat() || getInspectUseBoard())) {
reason.add("Either Board or Print in Scoreboard.Types.Inspect must be true!");
}*/
/* Database Purging */
if (getPurgeInterval() < -1) {
2019-02-18 13:56:33 -08:00
reason.add(DATABASE + PURGING + "." + PURGE_INTERVAL + " should be greater than, or equal to -1!");
2019-02-16 16:09:48 -08:00
}
if (getOldUsersCutoff() != -1 && getOldUsersCutoff() <= 0) {
2019-02-18 13:56:33 -08:00
reason.add(DATABASE + PURGING + "." + OLD_USER_CUTOFF + " should be greater than 0 or -1!");
2019-02-16 16:09:48 -08:00
}
/* Hardcore Mode */
if (getHardcoreDeathStatPenaltyPercentage() < 0.01 || getHardcoreDeathStatPenaltyPercentage() > 100) {
2019-02-18 13:56:33 -08:00
reason.add(HARDCORE + "." + DEATH_STAT_LOSS + "." + PENALTY_PERCENTAGE + " only accepts values from 0.01 to 100!");
2019-02-16 16:09:48 -08:00
}
if (getHardcoreVampirismStatLeechPercentage() < 0.01 || getHardcoreVampirismStatLeechPercentage() > 100) {
2019-02-18 13:56:33 -08:00
reason.add(HARDCORE + "." + VAMPIRISM + "." + LEECH_PERCENTAGE + " only accepts values from 0.01 to 100!");
2019-02-16 16:09:48 -08:00
}
/* Items */
if (getChimaeraUseCost() < 1 || getChimaeraUseCost() > 64) {
2019-02-18 13:56:33 -08:00
reason.add(ITEMS + "." + CHIMAERA_WING + "." + USE_COST + " only accepts values from 1 to 64!");
2019-02-16 16:09:48 -08:00
}
if (getChimaeraRecipeCost() < 1 || getChimaeraRecipeCost() > 9) {
2019-02-18 13:56:33 -08:00
reason.add(ITEMS + "." + CHIMAERA_WING + "." + RECIPE_COST + " only accepts values from 1 to 9!");
2019-02-16 16:09:48 -08:00
}
if (getChimaeraItem() == null) {
2019-02-18 13:56:33 -08:00
reason.add(ITEMS + "." + CHIMAERA_WING + "." + ITEM + NAME + " is invalid!");
2019-02-16 16:09:48 -08:00
}
/* Particles */
if (getLevelUpEffectsTier() < 1) {
2019-02-18 13:56:33 -08:00
reason.add(PARTICLES + "." + LEVEL_UP + "Tier should be at least 1!");
2019-02-16 16:09:48 -08:00
}
/* PARTY SETTINGS */
if (getAutoPartyKickInterval() < -1) {
2019-02-18 13:56:33 -08:00
reason.add(PARTY + "." + AUTO_KICK_INTERVAL + " should be at least -1!");
2019-02-16 16:09:48 -08:00
}
if (getAutoPartyKickTime() < 0) {
2019-02-18 13:56:33 -08:00
reason.add(PARTY + "." + OLD_PARTY_MEMBER_CUTOFF + " should be at least 0!");
2019-02-16 16:09:48 -08:00
}
if (getPartyShareBonusBase() <= 0) {
2019-02-18 13:56:33 -08:00
reason.add(PARTY + "." + SHARING_EXP_SHARE_BONUS_BASE + " should be greater than 0!");
2019-02-16 16:09:48 -08:00
}
if (getPartyShareBonusIncrease() < 0) {
2019-02-18 13:56:33 -08:00
reason.add(PARTY + "." + SHARING + "." + EXP_SHARE_BONUS_INCREASE + " should be at least 0!");
2019-02-16 16:09:48 -08:00
}
if (getPartyShareBonusCap() <= 0) {
2019-02-18 13:56:33 -08:00
reason.add(PARTY + "." + SHARING + "." + EXP_SHARE_BONUS_CAP + " should be greater than 0!");
2019-02-16 16:09:48 -08:00
}
if (getPartyShareRange() <= 0) {
2019-02-18 13:56:33 -08:00
reason.add(PARTY + "." + SHARING + "." + RANGE + " should be greater than 0!");
2019-02-16 16:09:48 -08:00
}
if (getPartyXpCurveMultiplier() < 1) {
2019-02-18 13:56:33 -08:00
reason.add(PARTY + "." + LEVELING + "." + XP_CURVE_MODIFIER + " should be at least 1!");
2019-02-16 16:09:48 -08:00
}
for (PartyFeature partyFeature : PartyFeature.values()) {
if (getPartyFeatureUnlockLevel(partyFeature) < 0) {
2019-02-18 13:56:33 -08:00
reason.add(PARTY + "." + LEVELING + "." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + "_UnlockLevel should be at least 0!");
2019-02-16 16:09:48 -08:00
}
}
/* Inspect command distance */
if (getInspectDistance() <= 0) {
2019-02-18 13:56:33 -08:00
reason.add(COMMANDS + "." + INSPECT1 + "." + MAX_DISTANCE + " should be greater than 0!");
2019-02-16 16:09:48 -08:00
}
if (getTreeFellerThreshold() <= 0) {
2019-02-18 13:56:33 -08:00
reason.add(ABILITIES + "." + LIMITS + "." + TREE_FELLER_THRESHOLD + " should be greater than 0!");
2019-02-16 16:09:48 -08:00
}
if (getFishingLureModifier() < 0) {
2019-02-18 13:56:33 -08:00
reason.add(ABILITIES + "." + FISHING + "." + LURE_MODIFIER + " should be at least 0!");
2019-02-16 16:09:48 -08:00
}
if (getDetonatorItem() == null) {
2019-02-18 13:56:33 -08:00
reason.add(SKILLS + "." + MINING + "." + DETONATOR + "Item is invalid!");
2019-02-16 16:09:48 -08:00
}
if (getRepairAnvilMaterial() == null) {
2019-02-18 13:56:33 -08:00
reason.add(SKILLS + "." + REPAIR + "." + ANVIL + "Type is invalid!!");
2019-02-16 16:09:48 -08:00
}
if (getSalvageAnvilMaterial() == null) {
2019-02-18 13:56:33 -08:00
reason.add(SKILLS + "." + REPAIR + "." + SALVAGE + "_" + ANVIL + "Type is invalid!");
2019-02-16 16:09:48 -08:00
}
if (getRepairAnvilMaterial() == getSalvageAnvilMaterial()) {
2019-02-18 13:56:33 -08:00
reason.add("Cannot use the same item for " + REPAIR + " and " + SALVAGE + " anvils!");
2019-02-16 16:09:48 -08:00
}
if (getTamingCOTWMaterial(EntityType.WOLF) == null) {
2019-02-18 13:56:33 -08:00
reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + ".Wolf." + ITEM + "Material is invalid!!");
2019-02-16 16:09:48 -08:00
}
if (getTamingCOTWMaterial(EntityType.OCELOT) == null) {
2019-02-18 13:56:33 -08:00
reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + ".Ocelot." + ITEM + "Material is invalid!!");
2019-02-16 16:09:48 -08:00
}
if (getTamingCOTWMaterial(EntityType.HORSE) == null) {
2019-02-18 13:56:33 -08:00
reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + ".Horse." + ITEM + "Material is invalid!!");
2019-02-16 16:09:48 -08:00
}
if (getTamingCOTWCost(EntityType.WOLF) <= 0) {
2019-02-18 13:56:33 -08:00
reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + ".Wolf." + ITEM + "Amount should be greater than 0!");
2019-02-16 16:09:48 -08:00
}
if (getTamingCOTWCost(EntityType.OCELOT) <= 0) {
2019-02-18 13:56:33 -08:00
reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + ".Ocelot." + ITEM + "Amount should be greater than 0!");
2019-02-16 16:09:48 -08:00
}
if (getTamingCOTWCost(EntityType.HORSE) <= 0) {
2019-02-18 13:56:33 -08:00
reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + ".Horse." + ITEM + "Amount should be greater than 0!");
2019-02-16 16:09:48 -08:00
}
if (getTamingCOTWAmount(EntityType.WOLF) <= 0) {
2019-02-18 13:56:33 -08:00
reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + ".Wolf." + SUMMON_AMOUNT + " should be greater than 0!");
2019-02-16 16:09:48 -08:00
}
if (getTamingCOTWAmount(EntityType.OCELOT) <= 0) {
2019-02-18 13:56:33 -08:00
reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + ".Ocelot." + SUMMON_AMOUNT + " should be greater than 0!");
2019-02-16 16:09:48 -08:00
}
if (getTamingCOTWAmount(EntityType.HORSE) <= 0) {
2019-02-18 13:56:33 -08:00
reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + ".Horse." + SUMMON_AMOUNT + " should be greater than 0!");
2019-02-16 16:09:48 -08:00
}
return reason;
}
/*
* GENERAL SETTINGS
*/
/* General Settings */
public boolean getIsMetricsEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(METRICS + "." + BSTATS);
2019-02-16 16:09:48 -08:00
}
//Retro mode will default the value to true if the config file doesn't contain the entry (server is from a previous mcMMO install)
public boolean getIsRetroMode() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(GENERAL + "." + RETRO_MODE + "." + ENABLED);
2019-02-16 16:09:48 -08:00
}
public String getLocale() {
2019-02-18 13:56:33 -08:00
return getStringValue(GENERAL + "." + LOCALE, EN_US);
2019-02-16 16:09:48 -08:00
}
public boolean getMOTDEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(GENERAL + "." + MOTD + ENABLED);
2019-02-16 16:09:48 -08:00
}
public boolean getShowProfileLoadedMessage() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(GENERAL + "." + SHOW_PROFILE_LOADED);
2019-02-16 16:09:48 -08:00
}
public boolean getDonateMessageEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(COMMANDS + "." + MCMMO + "." + DONATE_MESSAGE);
2019-02-16 16:09:48 -08:00
}
public int getSaveInterval() {
2019-02-18 13:56:33 -08:00
return getIntValue(GENERAL + "." + SAVE_INTERVAL);
2019-02-16 16:09:48 -08:00
}
public boolean getStatsTrackingEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(GENERAL + "." + STATS_TRACKING);
2019-02-16 16:09:48 -08:00
}
public boolean getUpdateCheckEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(GENERAL + "." + UPDATE_CHECK);
2019-02-16 16:09:48 -08:00
}
public boolean getPreferBeta() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(GENERAL + "." + PREFER_BETA);
2019-02-16 16:09:48 -08:00
}
public boolean getVerboseLoggingEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(GENERAL + "." + VERBOSE_LOGGING);
2019-02-16 16:09:48 -08:00
}
public String getPartyChatPrefix() {
2019-02-18 13:56:33 -08:00
return getStringValue(COMMANDS + "." + PARTYCHAT + "." + CHAT_PREFIX_FORMAT);
2019-02-16 16:09:48 -08:00
}
public boolean getPartyChatColorLeaderName() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(COMMANDS + "." + PARTYCHAT + "." + GOLD_LEADER_NAME);
2019-02-16 16:09:48 -08:00
}
public boolean getPartyDisplayNames() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(COMMANDS + "." + PARTYCHAT + "." + USE_DISPLAY_NAMES);
2019-02-16 16:09:48 -08:00
}
public String getPartyChatPrefixAlly() {
2019-02-18 13:56:33 -08:00
return getStringValue(COMMANDS + "." + PARTYCHAT + "." + CHAT_PREFIX_FORMAT + ALLY);
2019-02-16 16:09:48 -08:00
}
public String getAdminChatPrefix() {
2019-02-18 13:56:33 -08:00
return getStringValue(COMMANDS + "." + ADMINCHAT + "." + CHAT_PREFIX_FORMAT);
2019-02-16 16:09:48 -08:00
}
public boolean getAdminDisplayNames() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(COMMANDS + "." + ADMINCHAT + "." + USE_DISPLAY_NAMES);
2019-02-16 16:09:48 -08:00
}
public boolean getMatchOfflinePlayers() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(COMMANDS + "." + GENERIC + "." + MATCH_OFFLINE_PLAYERS);
2019-02-16 16:09:48 -08:00
}
public long getDatabasePlayerCooldown() {
2019-02-18 13:56:33 -08:00
return config.getLong(COMMANDS + "." + DATABASE + "." + PLAYER_COOLDOWN);
2019-02-16 16:09:48 -08:00
}
public boolean getLevelUpSoundsEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(GENERAL + "." + LEVEL_UP_SOUNDS);
2019-02-16 16:09:48 -08:00
}
public boolean getRefreshChunksEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(GENERAL + "." + REFRESH_CHUNKS);
2019-02-16 16:09:48 -08:00
}
public boolean getMobHealthbarEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(MOB_HEALTHBAR + "." + ENABLED);
2019-02-16 16:09:48 -08:00
}
/* Mob Healthbar */
public MobHealthbarType getMobHealthbarDefault() {
try {
2019-02-18 13:56:33 -08:00
return MobHealthbarType.valueOf(getStringValue(MOB_HEALTHBAR + "." + DISPLAY_TYPE, HEARTS).toUpperCase().trim());
2019-02-16 16:09:48 -08:00
} catch (IllegalArgumentException ex) {
return MobHealthbarType.HEARTS;
}
}
public int getMobHealthbarTime() {
2019-02-18 13:56:33 -08:00
return getIntValue(MOB_HEALTHBAR + "." + DISPLAY_TIME);
2019-02-16 16:09:48 -08:00
}
/* Scoreboards */
public boolean getScoreboardsEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SCOREBOARD + "." + USE_SCOREBOARDS);
2019-02-16 16:09:48 -08:00
}
public boolean getPowerLevelTagsEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SCOREBOARD + "." + POWER_LEVEL_TAGS);
2019-02-16 16:09:48 -08:00
}
public boolean getAllowKeepBoard() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SCOREBOARD + "." + ALLOW_KEEP);
2019-02-16 16:09:48 -08:00
}
public int getTipsAmount() {
2019-02-18 13:56:33 -08:00
return getIntValue(SCOREBOARD + "." + TIPS_AMOUNT);
2019-02-16 16:09:48 -08:00
}
public boolean getShowStatsAfterLogin() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SCOREBOARD + "." + SHOW_STATS_AFTER_LOGIN);
2019-02-16 16:09:48 -08:00
}
public boolean getScoreboardRainbows() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SCOREBOARD + "." + RAINBOWS);
2019-02-16 16:09:48 -08:00
}
public boolean getShowAbilityNames() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SCOREBOARD + "." + ABILITY_NAMES);
2019-02-16 16:09:48 -08:00
}
public boolean getRankUseChat() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SCOREBOARD + "." + TYPES + "." + RANK + "." + PRINT);
2019-02-16 16:09:48 -08:00
}
public boolean getRankUseBoard() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SCOREBOARD + "." + TYPES + "." + RANK + "." + BOARD);
2019-02-16 16:09:48 -08:00
}
public int getRankScoreboardTime() {
2019-02-18 13:56:33 -08:00
return getIntValue(SCOREBOARD + "." + TYPES + "." + RANK + "." + DISPLAY_TIME);
2019-02-16 16:09:48 -08:00
}
public boolean getTopUseChat() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SCOREBOARD + "." + TYPES + "." + TOP + "." + PRINT);
2019-02-16 16:09:48 -08:00
}
public boolean getTopUseBoard() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SCOREBOARD + "." + TYPES + "." + TOP + "." + BOARD);
2019-02-16 16:09:48 -08:00
}
public int getTopScoreboardTime() {
2019-02-18 13:56:33 -08:00
return getIntValue(SCOREBOARD + "." + TYPES + "." + TOP + "." + DISPLAY_TIME);
2019-02-16 16:09:48 -08:00
}
public boolean getStatsUseChat() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SCOREBOARD + "." + TYPES + "." + STATS + "." + PRINT);
2019-02-16 16:09:48 -08:00
}
public boolean getStatsUseBoard() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SCOREBOARD + "." + TYPES + "." + STATS + "." + BOARD);
2019-02-16 16:09:48 -08:00
}
public int getStatsScoreboardTime() {
2019-02-18 13:56:33 -08:00
return getIntValue(SCOREBOARD + "." + TYPES + "." + STATS + "." + DISPLAY_TIME);
2019-02-16 16:09:48 -08:00
}
public boolean getInspectUseChat() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SCOREBOARD + "." + TYPES + "." + INSPECT + "." + PRINT);
2019-02-16 16:09:48 -08:00
}
public boolean getInspectUseBoard() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SCOREBOARD + "." + TYPES + "." + INSPECT + "." + BOARD);
2019-02-16 16:09:48 -08:00
}
public int getInspectScoreboardTime() {
2019-02-18 13:56:33 -08:00
return getIntValue(SCOREBOARD + "." + TYPES + "." + INSPECT + "." + DISPLAY_TIME);
2019-02-16 16:09:48 -08:00
}
public boolean getCooldownUseChat() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SCOREBOARD + "." + TYPES + "." + COOLDOWN + "." + PRINT);
2019-02-16 16:09:48 -08:00
}
public boolean getCooldownUseBoard() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SCOREBOARD + "." + TYPES + "." + COOLDOWN + "." + BOARD);
2019-02-16 16:09:48 -08:00
}
public int getCooldownScoreboardTime() {
2019-02-18 13:56:33 -08:00
return getIntValue(SCOREBOARD + "." + TYPES + "." + COOLDOWN + "." + DISPLAY_TIME);
2019-02-16 16:09:48 -08:00
}
public boolean getSkillUseBoard() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SCOREBOARD + "." + TYPES + "." + SKILL + "." + BOARD);
2019-02-16 16:09:48 -08:00
}
public int getSkillScoreboardTime() {
2019-02-18 13:56:33 -08:00
return getIntValue(SCOREBOARD + "." + TYPES + "." + SKILL + "." + DISPLAY_TIME);
2019-02-16 16:09:48 -08:00
}
public boolean getSkillLevelUpBoard() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SCOREBOARD + "." + TYPES + "." + SKILL + "." + LEVEL_UP + BOARD);
2019-02-16 16:09:48 -08:00
}
public int getSkillLevelUpTime() {
2019-02-18 13:56:33 -08:00
return getIntValue(SCOREBOARD + "." + TYPES + "." + SKILL + "." + LEVEL_UP + TIME);
2019-02-16 16:09:48 -08:00
}
/* Database Purging */
public int getPurgeInterval() {
2019-02-18 13:56:33 -08:00
return getIntValue(DATABASE + PURGING + "." + PURGE_INTERVAL);
2019-02-16 16:09:48 -08:00
}
public int getOldUsersCutoff() {
2019-02-18 13:56:33 -08:00
return getIntValue(DATABASE + PURGING + "." + OLD_USER_CUTOFF);
2019-02-16 16:09:48 -08:00
}
/* Backups */
public boolean getBackupsEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(BACKUPS + "." + ENABLED);
2019-02-16 16:09:48 -08:00
}
public boolean getKeepLast24Hours() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(BACKUPS + "." + KEEP_LAST_24_HOURS);
2019-02-16 16:09:48 -08:00
}
public boolean getKeepDailyLastWeek() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(BACKUPS + "." + KEEP + "." + DAILY_LAST_WEEK);
2019-02-16 16:09:48 -08:00
}
public boolean getKeepWeeklyPastMonth() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(BACKUPS + "." + KEEP + "." + WEEKLY_PAST_MONTHS);
2019-02-16 16:09:48 -08:00
}
/* mySQL */
public boolean getUseMySQL() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(MY_SQL + "." + ENABLED);
2019-02-16 16:09:48 -08:00
}
public String getMySQLTablePrefix() {
2019-02-18 13:56:33 -08:00
return getStringValue(MY_SQL + "." + DATABASE + "." + TABLE_PREFIX, DATABASE_PREFIX);
2019-02-16 16:09:48 -08:00
}
public String getMySQLDatabaseName() {
2019-02-18 13:56:33 -08:00
return getStringIncludingInts(MY_SQL + "." + DATABASE + "." + NAME);
2019-02-16 16:09:48 -08:00
}
public String getMySQLUserName() {
2019-02-18 13:56:33 -08:00
return getStringIncludingInts(MY_SQL + "." + DATABASE + "." + USER_NAME);
2019-02-16 16:09:48 -08:00
}
public int getMySQLServerPort() {
2019-02-18 13:56:33 -08:00
return getIntValue(MY_SQL + "." + SERVER + "." + PORT);
2019-02-16 16:09:48 -08:00
}
public String getMySQLServerName() {
2019-02-18 13:56:33 -08:00
return getStringValue(MY_SQL + "." + SERVER + "." + ADDRESS, LOCALHOST);
2019-02-16 16:09:48 -08:00
}
public String getMySQLUserPassword() {
2019-02-18 13:56:33 -08:00
return getStringIncludingInts(MY_SQL + "." + DATABASE + "." + USER_PASSWORD);
2019-02-16 16:09:48 -08:00
}
public int getMySQLMaxConnections(SQLDatabaseManager.PoolIdentifier identifier) {
2019-02-18 13:56:33 -08:00
return getIntValue(MY_SQL + "." + DATABASE + "." + MAX_CONNECTIONS + "." + StringUtils.getCapitalized(identifier.toString()));
2019-02-16 16:09:48 -08:00
}
public int getMySQLMaxPoolSize(SQLDatabaseManager.PoolIdentifier identifier) {
2019-02-18 13:56:33 -08:00
return getIntValue(MY_SQL + "." + DATABASE + "." + MAX_POOL_SIZE + "." + StringUtils.getCapitalized(identifier.toString()));
2019-02-16 16:09:48 -08:00
}
public boolean getMySQLSSL() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(MY_SQL + "." + SERVER + "." + SSL);
2019-02-16 16:09:48 -08:00
}
2019-02-18 13:56:33 -08:00
ssadprivate String getStringIncludingInts(String[] key) {
2019-02-16 16:09:48 -08:00
String str = getStringValue(key);
if (str == null) {
str = String.valueOf(getIntValue(key));
}
if (str.equals("0")) {
str = "No value set for '" + key + "'";
}
return str;
}
/* Hardcore Mode */
public boolean getHardcoreStatLossEnabled(PrimarySkillType primarySkillType) {
2019-02-18 13:56:33 -08:00
return getBooleanValue(HARDCORE + "." + DEATH_STAT_LOSS + "." + ENABLED + "." + StringUtils.getCapitalized(primarySkillType.toString()));
2019-02-16 16:09:48 -08:00
}
public void setHardcoreStatLossEnabled(PrimarySkillType primarySkillType, boolean enabled) {
2019-02-18 13:56:33 -08:00
config.set(HARDCORE + "." + DEATH_STAT_LOSS + "." + ENABLED + "." + StringUtils.getCapitalized(primarySkillType.toString()), enabled);
2019-02-16 16:09:48 -08:00
}
public double getHardcoreDeathStatPenaltyPercentage() {
2019-02-18 13:56:33 -08:00
return getDoubleValue(HARDCORE + "." + DEATH_STAT_LOSS + "." + PENALTY_PERCENTAGE);
2019-02-16 16:09:48 -08:00
}
public void setHardcoreDeathStatPenaltyPercentage(double value) {
2019-02-18 13:56:33 -08:00
config.set(HARDCORE + "." + DEATH_STAT_LOSS + "." + PENALTY_PERCENTAGE, value);
2019-02-16 16:09:48 -08:00
}
public int getHardcoreDeathStatPenaltyLevelThreshold() {
2019-02-18 13:56:33 -08:00
return getIntValue(HARDCORE + "." + DEATH_STAT_LOSS + "." + LEVEL_THRESHOLD);
2019-02-16 16:09:48 -08:00
}
public boolean getHardcoreVampirismEnabled(PrimarySkillType primarySkillType) {
2019-02-18 13:56:33 -08:00
return getBooleanValue(HARDCORE + "." + VAMPIRISM + "." + ENABLED + "." + StringUtils.getCapitalized(primarySkillType.toString()));
2019-02-16 16:09:48 -08:00
}
public void setHardcoreVampirismEnabled(PrimarySkillType primarySkillType, boolean enabled) {
2019-02-18 13:56:33 -08:00
config.set(HARDCORE + "." + VAMPIRISM + "." + ENABLED + "." + StringUtils.getCapitalized(primarySkillType.toString()), enabled);
2019-02-16 16:09:48 -08:00
}
public double getHardcoreVampirismStatLeechPercentage() {
2019-02-18 13:56:33 -08:00
return getDoubleValue(HARDCORE + "." + VAMPIRISM + "." + LEECH_PERCENTAGE);
2019-02-16 16:09:48 -08:00
}
public void setHardcoreVampirismStatLeechPercentage(double value) {
2019-02-18 13:56:33 -08:00
config.set(HARDCORE + "." + VAMPIRISM + "." + LEECH_PERCENTAGE, value);
2019-02-16 16:09:48 -08:00
}
public int getHardcoreVampirismLevelThreshold() {
2019-02-18 13:56:33 -08:00
return getIntValue(HARDCORE + "." + VAMPIRISM + "." + LEVEL_THRESHOLD);
2019-02-16 16:09:48 -08:00
}
/* Items */
public int getChimaeraUseCost() {
2019-02-18 13:56:33 -08:00
return getIntValue(ITEMS + "." + CHIMAERA_WING + "." + USE_COST);
2019-02-16 16:09:48 -08:00
}
public int getChimaeraRecipeCost() {
2019-02-18 13:56:33 -08:00
return getIntValue(ITEMS + "." + CHIMAERA_WING + "." + RECIPE_COST);
2019-02-16 16:09:48 -08:00
}
public Material getChimaeraItem() {
2019-02-18 13:56:33 -08:00
return Material.matchMaterial(getStringValue(ITEMS + "." + CHIMAERA_WING + "." + ITEM + NAME, FEATHER));
2019-02-16 16:09:48 -08:00
}
public boolean getChimaeraEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(ITEMS + "." + CHIMAERA_WING + "." + ENABLED);
2019-02-16 16:09:48 -08:00
}
public boolean getChimaeraPreventUseUnderground() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(ITEMS + "." + CHIMAERA_WING + "." + PREVENT_USE_UNDERGROUND);
2019-02-16 16:09:48 -08:00
}
public boolean getChimaeraUseBedSpawn() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(ITEMS + "." + CHIMAERA_WING + "." + USE_BED_SPAWN);
2019-02-16 16:09:48 -08:00
}
public int getChimaeraCooldown() {
2019-02-18 13:56:33 -08:00
return getIntValue(ITEMS + "." + CHIMAERA_WING + "." + COOLDOWN);
2019-02-16 16:09:48 -08:00
}
public int getChimaeraWarmup() {
2019-02-18 13:56:33 -08:00
return getIntValue(ITEMS + "." + CHIMAERA_WING + "." + WARMUP);
2019-02-16 16:09:48 -08:00
}
public int getChimaeraRecentlyHurtCooldown() {
2019-02-18 13:56:33 -08:00
return getIntValue(ITEMS + "." + CHIMAERA_WING + "." + RECENTLY_HURT + COOLDOWN);
2019-02-16 16:09:48 -08:00
}
public boolean getChimaeraSoundEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(ITEMS + "." + CHIMAERA_WING + "." + SOUND + "_" + ENABLED);
2019-02-16 16:09:48 -08:00
}
public boolean getFluxPickaxeSoundEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(ITEMS + "." + FLUX + "_Pickaxe." + SOUND + "_" + ENABLED);
2019-02-16 16:09:48 -08:00
}
/* Particles */
public boolean getAbilityActivationEffectEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(PARTICLES + "." + ABILITY_ACTIVATION);
2019-02-16 16:09:48 -08:00
}
public boolean getAbilityDeactivationEffectEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(PARTICLES + "." + ABILITY_DEACTIVATION);
2019-02-16 16:09:48 -08:00
}
public boolean getBleedEffectEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(PARTICLES + "." + BLEED);
2019-02-16 16:09:48 -08:00
}
public boolean getDodgeEffectEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(PARTICLES + "." + DODGE);
2019-02-16 16:09:48 -08:00
}
public boolean getFluxEffectEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(PARTICLES + "." + FLUX);
2019-02-16 16:09:48 -08:00
}
public boolean getGreaterImpactEffectEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(PARTICLES + "." + GREATER_IMPACT);
2019-02-16 16:09:48 -08:00
}
public boolean getCallOfTheWildEffectEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(PARTICLES + "." + CALL_OF_THE_WILD);
2019-02-16 16:09:48 -08:00
}
public boolean getLevelUpEffectsEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(PARTICLES + "." + LEVEL_UP + ENABLED);
2019-02-16 16:09:48 -08:00
}
public int getLevelUpEffectsTier() {
2019-02-18 13:56:33 -08:00
return getIntValue(PARTICLES + "." + LEVEL_UP + TIER);
2019-02-16 16:09:48 -08:00
}
public boolean getLargeFireworks() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(PARTICLES + "." + LARGE_FIREWORKS);
2019-02-16 16:09:48 -08:00
}
/* PARTY SETTINGS */
public boolean getPartyFriendlyFire() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(PARTY + "." + FRIENDLY_FIRE);
2019-02-16 16:09:48 -08:00
}
public int getPartyMaxSize() {
2019-02-18 13:56:33 -08:00
return getIntValue(PARTY + "." + MAX_SIZE);
2019-02-16 16:09:48 -08:00
}
public int getAutoPartyKickInterval() {
2019-02-18 13:56:33 -08:00
return getIntValue(PARTY + "." + AUTO_KICK_INTERVAL);
2019-02-16 16:09:48 -08:00
}
public int getAutoPartyKickTime() {
2019-02-18 13:56:33 -08:00
return getIntValue(PARTY + "." + OLD_PARTY_MEMBER_CUTOFF);
2019-02-16 16:09:48 -08:00
}
public double getPartyShareBonusBase() {
2019-02-18 13:56:33 -08:00
return getDoubleValue(PARTY + "." + SHARING_EXP_SHARE_BONUS_BASE);
2019-02-16 16:09:48 -08:00
}
public double getPartyShareBonusIncrease() {
2019-02-18 13:56:33 -08:00
return getDoubleValue(PARTY + "." + SHARING + "." + EXP_SHARE_BONUS_INCREASE);
2019-02-16 16:09:48 -08:00
}
public double getPartyShareBonusCap() {
2019-02-18 13:56:33 -08:00
return getDoubleValue(PARTY + "." + SHARING + "." + EXP_SHARE_BONUS_CAP);
2019-02-16 16:09:48 -08:00
}
public double getPartyShareRange() {
2019-02-18 13:56:33 -08:00
return getDoubleValue(PARTY + "." + SHARING + "." + RANGE);
2019-02-16 16:09:48 -08:00
}
public int getPartyLevelCap() {
2019-02-18 13:56:33 -08:00
int cap = getIntValue(PARTY + "." + LEVELING + "." + LEVEL_CAP);
2019-02-16 16:09:48 -08:00
return (cap <= 0) ? Integer.MAX_VALUE : cap;
}
2019-02-18 13:56:33 -08:00
//TODO: Move this to Experience Config
2019-02-16 16:09:48 -08:00
public int getPartyXpCurveMultiplier() {
2019-02-18 13:56:33 -08:00
return getIntValue(PARTY + "." + LEVELING + "." + XP_CURVE_MODIFIER);
2019-02-16 16:09:48 -08:00
}
public boolean getPartyXpNearMembersNeeded() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(PARTY + "." + LEVELING + "." + NEAR_MEMBERS_NEEDED);
2019-02-16 16:09:48 -08:00
}
public boolean getPartyInformAllMembers() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(PARTY + "." + LEVELING + "." + INFORM_ALL_PARTY_MEMBERS_ON_LEVEL_UP);
2019-02-16 16:09:48 -08:00
}
public int getPartyFeatureUnlockLevel(PartyFeature partyFeature) {
2019-02-18 13:56:33 -08:00
return getIntValue(PARTY + "." + LEVELING + "." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + UNLOCK_LEVEL);
2019-02-16 16:09:48 -08:00
}
/* Party Teleport Settings */
public int getPTPCommandCooldown() {
2019-02-18 13:56:33 -08:00
return getIntValue(COMMANDS + "." + PTP + "." + COOLDOWN);
2019-02-16 16:09:48 -08:00
}
public int getPTPCommandWarmup() {
2019-02-18 13:56:33 -08:00
return getIntValue(COMMANDS + "." + PTP + "." + WARMUP);
2019-02-16 16:09:48 -08:00
}
public int getPTPCommandRecentlyHurtCooldown() {
2019-02-18 13:56:33 -08:00
return getIntValue(COMMANDS + "." + PTP + "." + RECENTLY_HURT + COOLDOWN);
2019-02-16 16:09:48 -08:00
}
public int getPTPCommandTimeout() {
2019-02-18 13:56:33 -08:00
return getIntValue(COMMANDS + "." + PTP + "." + REQUEST_TIMEOUT);
2019-02-16 16:09:48 -08:00
}
public boolean getPTPCommandConfirmRequired() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(COMMANDS + "." + PTP + "." + ACCEPT_REQUIRED);
2019-02-16 16:09:48 -08:00
}
public boolean getPTPCommandWorldPermissions() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(COMMANDS + "." + PTP + "." + WORLD_BASED_PERMISSIONS);
2019-02-16 16:09:48 -08:00
}
/* Inspect command distance */
public double getInspectDistance() {
2019-02-18 13:56:33 -08:00
return getDoubleValue(COMMANDS + "." + INSPECT1 + "." + MAX_DISTANCE);
2019-02-16 16:09:48 -08:00
}
/*
* ABILITY SETTINGS
*/
/* General Settings */
public boolean getUrlLinksEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(COMMANDS + "." + SKILLS + "." + URL_LINKS);
2019-02-16 16:09:48 -08:00
}
public boolean getAbilityMessagesEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(ABILITIES + "." + MESSAGES);
2019-02-16 16:09:48 -08:00
}
public boolean getAbilitiesEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(ABILITIES + "." + ENABLED);
2019-02-16 16:09:48 -08:00
}
public boolean getAbilitiesOnlyActivateWhenSneaking() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(ABILITIES + "." + ACTIVATION + "." + ONLY_ACTIVATE_WHEN_SNEAKING);
2019-02-16 16:09:48 -08:00
}
public boolean getAbilitiesGateEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(ABILITIES + "." + ACTIVATION + "." + LEVEL_GATE_ABILITIES);
2019-02-16 16:09:48 -08:00
}
public int getCooldown(SuperAbilityType ability) {
2019-02-18 13:56:33 -08:00
return getIntValue(ABILITIES + "." + COOLDOWNS + ability.toString());
2019-02-16 16:09:48 -08:00
}
public int getMaxLength(SuperAbilityType ability) {
2019-02-18 13:56:33 -08:00
return getIntValue(ABILITIES + "." + MAX_SECONDS + "." + ability.toString());
2019-02-16 16:09:48 -08:00
}
/* Durability Settings */
public int getAbilityToolDamage() {
2019-02-18 13:56:33 -08:00
return getIntValue(ABILITIES + "." + TOOLS + "." + DURABILITY_LOSS);
2019-02-16 16:09:48 -08:00
}
/* Thresholds */
public int getTreeFellerThreshold() {
2019-02-18 13:56:33 -08:00
return getIntValue(ABILITIES + "." + LIMITS + "." + TREE_FELLER_THRESHOLD);
2019-02-16 16:09:48 -08:00
}
/*
* SKILL SETTINGS
*/
public boolean getDoubleDropsEnabled(PrimarySkillType skill, Material material) {
2019-02-18 13:56:33 -08:00
return getBooleanValue(DOUBLE_DROPS + "." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_"));
2019-02-16 16:09:48 -08:00
}
public boolean getDoubleDropsDisabled(PrimarySkillType skill) {
String skillName = StringUtils.getCapitalized(skill.toString());
2019-02-18 13:56:33 -08:00
ConfigurationSection section = config.getConfigurationSection(DOUBLE_DROPS + "." + skillName);
2019-02-16 16:09:48 -08:00
if (section == null)
return false;
Set<String> keys = section.getKeys(false);
boolean disabled = true;
for (String key : keys) {
2019-02-18 13:56:33 -08:00
if (getBooleanValue(DOUBLE_DROPS + "." + skillName + "." + key)) {
2019-02-16 16:09:48 -08:00
disabled = false;
break;
}
}
return disabled;
}
/* Axes */
2019-02-18 13:56:33 -08:00
/*public int getAxesGate() {
return getIntValue(SKILLS + "." + AXES + "." + ABILITY_ACTIVATION + "_Level_Gate", 10);
}*/
2019-02-16 16:09:48 -08:00
/* Acrobatics */
public boolean getDodgeLightningDisabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + ACROBATICS + "." + PREVENT + DODGE + LIGHTNING);
2019-02-16 16:09:48 -08:00
}
public int getXPAfterTeleportCooldown() {
2019-02-18 13:56:33 -08:00
return getIntValue(SKILLS + "." + ACROBATICS + "." + XP_AFTER_TELEPORT + COOLDOWN);
2019-02-16 16:09:48 -08:00
}
/* Alchemy */
public boolean getEnabledForHoppers() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + ALCHEMY + "." + ENABLED + FOR_HOPPERS);
2019-02-16 16:09:48 -08:00
}
public boolean getPreventHopperTransferIngredients() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + ALCHEMY + "." + PREVENT_HOPPER_TRANSFER_INGREDIENTS);
2019-02-16 16:09:48 -08:00
}
public boolean getPreventHopperTransferBottles() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + ALCHEMY + "." + PREVENT_HOPPER_TRANSFER_BOTTLES);
2019-02-16 16:09:48 -08:00
}
/* Fishing */
public boolean getFishingDropsEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + FISHING + "." + DROPS + ENABLED);
2019-02-16 16:09:48 -08:00
}
public boolean getFishingOverrideTreasures() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + FISHING + "." + OVERRIDE_VANILLA_TREASURES);
2019-02-16 16:09:48 -08:00
}
public boolean getFishingExtraFish() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + FISHING + "." + EXTRA_FISH);
2019-02-16 16:09:48 -08:00
}
public double getFishingLureModifier() {
2019-02-18 13:56:33 -08:00
return getDoubleValue(SKILLS + "." + FISHING + "." + LURE_MODIFIER);
2019-02-16 16:09:48 -08:00
}
/* Mining */
public Material getDetonatorItem() {
2019-02-18 13:56:33 -08:00
return Material.matchMaterial(getStringValue(SKILLS + "." + MINING + "." + DETONATOR + NAME, FLINT_AND_STEEL));
2019-02-16 16:09:48 -08:00
}
/* Repair */
public boolean getRepairAnvilMessagesEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + REPAIR + "." + ANVIL + MESSAGES);
2019-02-16 16:09:48 -08:00
}
public boolean getRepairAnvilPlaceSoundsEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + REPAIR + "." + ANVIL_PLACED + SOUNDS);
2019-02-16 16:09:48 -08:00
}
public boolean getRepairAnvilUseSoundsEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + REPAIR + "." + ANVIL_USE + SOUNDS);
2019-02-16 16:09:48 -08:00
}
public Material getRepairAnvilMaterial() {
2019-02-18 13:56:33 -08:00
return Material.matchMaterial(getStringValue(SKILLS + "." + REPAIR + "." + ANVIL_MATERIAL, IRON_BLOCK));
2019-02-16 16:09:48 -08:00
}
public boolean getRepairConfirmRequired() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + REPAIR + "." + CONFIRM_REQUIRED);
2019-02-16 16:09:48 -08:00
}
/* Salvage */
public boolean getSalvageAnvilMessagesEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + SALVAGE + "." + ANVIL + MESSAGES, true);
2019-02-16 16:09:48 -08:00
}
public boolean getSalvageAnvilPlaceSoundsEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + SALVAGE + "." + ANVIL_PLACED + SOUNDS, true);
2019-02-16 16:09:48 -08:00
}
public boolean getSalvageAnvilUseSoundsEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + SALVAGE + "." + ANVIL_USE + SOUNDS, true);
2019-02-16 16:09:48 -08:00
}
public Material getSalvageAnvilMaterial() {
2019-02-18 13:56:33 -08:00
return Material.matchMaterial(getStringValue(SKILLS + "." + SALVAGE + "." + ANVIL_MATERIAL, GOLD_BLOCK));
2019-02-16 16:09:48 -08:00
}
public boolean getSalvageConfirmRequired() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + SALVAGE + "." + CONFIRM_REQUIRED);
2019-02-16 16:09:48 -08:00
}
/* Unarmed */
public boolean getUnarmedBlockCrackerSmoothbrickToCracked() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + UNARMED + "." + BLOCK_CRACKER + "." + SMOOTH_BRICK_TO_CRACKED_BRICK);
2019-02-16 16:09:48 -08:00
}
public boolean getUnarmedItemPickupDisabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + UNARMED + "." + ITEM + PICKUP_DISABLED_FULL_INVENTORY);
2019-02-16 16:09:48 -08:00
}
public boolean getUnarmedItemsAsUnarmed() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + UNARMED + "." + ITEMS + AS + UNARMED);
2019-02-16 16:09:48 -08:00
}
/* Taming */
public Material getTamingCOTWMaterial(EntityType type) {
2019-02-18 13:56:33 -08:00
return Material.matchMaterial(getStringValue(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + "." + StringUtils.getPrettyEntityTypeString(type) + "." + ITEM + MATERIAL));
2019-02-16 16:09:48 -08:00
}
public int getTamingCOTWCost(EntityType type) {
2019-02-18 13:56:33 -08:00
return getIntValue(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + "." + StringUtils.getPrettyEntityTypeString(type) + "." + ITEM + AMOUNT);
2019-02-16 16:09:48 -08:00
}
public int getTamingCOTWAmount(EntityType type) {
2019-02-18 13:56:33 -08:00
return getIntValue(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + "." + StringUtils.getPrettyEntityTypeString(type) + "." + SUMMON_AMOUNT);
2019-02-16 16:09:48 -08:00
}
public int getTamingCOTWLength(EntityType type) {
2019-02-18 13:56:33 -08:00
return getIntValue(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + "." + StringUtils.getPrettyEntityTypeString(type) + "." + SUMMON_LENGTH);
2019-02-16 16:09:48 -08:00
}
public int getTamingCOTWMaxAmount(EntityType type) {
2019-02-18 13:56:33 -08:00
return getIntValue(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + "." + StringUtils.getPrettyEntityTypeString(type) + "." + SUMMON_MAX_AMOUNT);
2019-02-16 16:09:48 -08:00
}
public double getTamingCOTWRange() {
2019-02-18 13:56:33 -08:00
return getDoubleValue(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + "." + RANGE);
2019-02-16 16:09:48 -08:00
}
/* Woodcutting */
public boolean getWoodcuttingDoubleDropsEnabled(BlockData material) {
2019-02-18 13:56:33 -08:00
return getBooleanValue(DOUBLE_DROPS + "." + WOODCUTTING + "." + StringUtils.getFriendlyConfigBlockDataString(material));
2019-02-16 16:09:48 -08:00
}
public boolean getTreeFellerSoundsEnabled() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + WOODCUTTING + "." + TREE_FELLER + SOUNDS);
2019-02-16 16:09:48 -08:00
}
/* AFK Leveling */
public boolean getAcrobaticsPreventAFK() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + ACROBATICS + "." + PREVENT_AFK + LEVELING);
2019-02-16 16:09:48 -08:00
}
public int getAcrobaticsAFKMaxTries() {
2019-02-18 13:56:33 -08:00
return getIntValue(SKILLS + "." + ACROBATICS + "." + MAX_TRIES_AT_SAME_LOCATION);
2019-02-16 16:09:48 -08:00
}
public boolean getHerbalismPreventAFK() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + HERBALISM + "." + PREVENT_AFK + LEVELING);
2019-02-16 16:09:48 -08:00
}
/* Level Caps */
public int getPowerLevelCap() {
2019-02-18 13:56:33 -08:00
int cap = getIntValue(GENERAL + "." + POWER + LEVEL_CAP);
2019-02-16 16:09:48 -08:00
return (cap <= 0) ? Integer.MAX_VALUE : cap;
}
public int getLevelCap(PrimarySkillType skill) {
2019-02-18 13:56:33 -08:00
int cap = getIntValue(SKILLS + "." + StringUtils.getCapitalized(skill.toString()) + "." + LEVEL_CAP);
2019-02-16 16:09:48 -08:00
return (cap <= 0) ? Integer.MAX_VALUE : cap;
}
public boolean getTruncateSkills() {
2019-02-18 13:56:33 -08:00
return getBooleanValue(GENERAL + "." + TRUNCATE + SKILLS);
2019-02-16 16:09:48 -08:00
}
/* PVP & PVE Settings */
public boolean getPVPEnabled(PrimarySkillType skill) {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + StringUtils.getCapitalized(skill.toString()) + "." + ENABLED + FOR_PVP);
2019-02-16 16:09:48 -08:00
}
public boolean getPVEEnabled(PrimarySkillType skill) {
2019-02-18 13:56:33 -08:00
return getBooleanValue(SKILLS + "." + StringUtils.getCapitalized(skill.toString()) + "." + ENABLED + FOR_PVE);
2019-02-16 16:09:48 -08:00
}
}