2012-04-26 16:32:38 +02:00
|
|
|
package com.gmail.nossr50.config;
|
|
|
|
|
2014-08-19 23:57:52 +02:00
|
|
|
import com.gmail.nossr50.database.SQLDatabaseManager.PoolIdentifier;
|
2013-04-05 04:11:11 +02:00
|
|
|
import com.gmail.nossr50.datatypes.MobHealthbarType;
|
2013-11-11 17:42:57 +01:00
|
|
|
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
2019-01-13 08:54:53 +01:00
|
|
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
2019-01-15 07:11:58 +01:00
|
|
|
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
|
2013-02-20 22:44:15 +01:00
|
|
|
import com.gmail.nossr50.util.StringUtils;
|
2018-07-31 02:44:10 +02:00
|
|
|
import org.bukkit.Material;
|
|
|
|
import org.bukkit.block.data.BlockData;
|
|
|
|
import org.bukkit.configuration.ConfigurationSection;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Set;
|
2012-05-01 21:56:09 +02:00
|
|
|
|
2013-02-24 06:18:01 +01:00
|
|
|
public class Config extends AutoUpdateConfigLoader {
|
2012-04-28 08:38:16 +02:00
|
|
|
private static Config instance;
|
2012-07-03 21:57:24 +02:00
|
|
|
|
|
|
|
private Config() {
|
|
|
|
super("config.yml");
|
2013-08-20 21:51:12 +02:00
|
|
|
validate();
|
2012-07-03 21:57:24 +02:00
|
|
|
}
|
2012-04-27 16:39:08 +02:00
|
|
|
|
2012-04-27 05:58:21 +02:00
|
|
|
public static Config getInstance() {
|
2012-04-27 16:54:51 +02:00
|
|
|
if (instance == null) {
|
2012-07-03 21:57:24 +02:00
|
|
|
instance = new Config();
|
2012-04-27 16:54:51 +02:00
|
|
|
}
|
|
|
|
|
2012-04-27 05:58:21 +02:00
|
|
|
return instance;
|
|
|
|
}
|
2012-04-26 16:32:38 +02:00
|
|
|
|
2019-01-20 04:18:29 +01:00
|
|
|
@Override
|
|
|
|
protected void loadKeys() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-07-03 21:57:24 +02:00
|
|
|
@Override
|
2013-08-20 21:51:12 +02:00
|
|
|
protected boolean validateKeys() {
|
2013-07-12 18:49:02 +02:00
|
|
|
// Validate all the settings!
|
|
|
|
List<String> reason = new ArrayList<String>();
|
|
|
|
|
|
|
|
/* General Settings */
|
|
|
|
if (getSaveInterval() <= 0) {
|
|
|
|
reason.add("General.Save_Interval should be greater than 0!");
|
|
|
|
}
|
|
|
|
|
2014-08-19 23:57:52 +02:00
|
|
|
/* MySQL Settings */
|
|
|
|
for (PoolIdentifier identifier : PoolIdentifier.values()) {
|
|
|
|
if (getMySQLMaxConnections(identifier) <= 0) {
|
|
|
|
reason.add("MySQL.Database.MaxConnections." + StringUtils.getCapitalized(identifier.toString()) + " should be greater than 0!");
|
|
|
|
}
|
|
|
|
if (getMySQLMaxPoolSize(identifier) <= 0) {
|
|
|
|
reason.add("MySQL.Database.MaxPoolSize." + StringUtils.getCapitalized(identifier.toString()) + " should be greater than 0!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-12 18:49:02 +02:00
|
|
|
/* Mob Healthbar */
|
|
|
|
if (getMobHealthbarTime() == 0) {
|
|
|
|
reason.add("Mob_Healthbar.Display_Time cannot be 0! Set to -1 to disable or set a valid value.");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Scoreboards */
|
2019-01-18 23:24:37 +01:00
|
|
|
/*if (getRankScoreboardTime() != -1 && getRankScoreboardTime() <= 0) {
|
2013-09-12 04:42:27 +02:00
|
|
|
reason.add("Scoreboard.Types.Rank.Display_Time should be greater than 0, or -1!");
|
2013-07-12 18:49:02 +02:00
|
|
|
}
|
|
|
|
|
2013-09-12 04:42:27 +02:00
|
|
|
if (getStatsScoreboardTime() != -1 && getStatsScoreboardTime() <= 0) {
|
|
|
|
reason.add("Scoreboard.Types.Stats.Display_Time should be greater than 0, or -1!");
|
2013-07-12 18:49:02 +02:00
|
|
|
}
|
|
|
|
|
2013-09-12 04:42:27 +02:00
|
|
|
if (getTopScoreboardTime() != -1 && getTopScoreboardTime() <= 0) {
|
|
|
|
reason.add("Scoreboard.Types.Top.Display_Time should be greater than 0, or -1!");
|
2013-07-12 18:49:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (getInspectScoreboardTime() != -1 && getInspectScoreboardTime() <= 0) {
|
2013-09-12 04:42:27 +02:00
|
|
|
reason.add("Scoreboard.Types.Inspect.Display_Time should be greater than 0, or -1!");
|
2013-07-12 18:49:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (getSkillScoreboardTime() != -1 && getSkillScoreboardTime() <= 0) {
|
2013-09-12 04:42:27 +02:00
|
|
|
reason.add("Scoreboard.Types.Skill.Display_Time should be greater than 0, or -1!");
|
2013-07-12 18:49:02 +02:00
|
|
|
}
|
|
|
|
|
2013-09-12 04:42:27 +02:00
|
|
|
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!");
|
2019-01-18 23:24:37 +01:00
|
|
|
}*/
|
2013-09-12 04:42:27 +02:00
|
|
|
|
2013-07-12 18:49:02 +02:00
|
|
|
/* Database Purging */
|
2013-07-29 00:37:13 +02:00
|
|
|
if (getPurgeInterval() < -1) {
|
2013-07-12 18:49:02 +02:00
|
|
|
reason.add("Database_Purging.Purge_Interval should be greater than, or equal to -1!");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (getOldUsersCutoff() != -1 && getOldUsersCutoff() <= 0) {
|
|
|
|
reason.add("Database_Purging.Old_User_Cutoff should be greater than 0 or -1!");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Hardcore Mode */
|
2013-09-13 02:51:54 +02:00
|
|
|
if (getHardcoreDeathStatPenaltyPercentage() < 0.01 || getHardcoreDeathStatPenaltyPercentage() > 100) {
|
|
|
|
reason.add("Hardcore.Death_Stat_Loss.Penalty_Percentage only accepts values from 0.01 to 100!");
|
2013-07-12 18:49:02 +02:00
|
|
|
}
|
|
|
|
|
2013-09-13 02:51:54 +02:00
|
|
|
if (getHardcoreVampirismStatLeechPercentage() < 0.01 || getHardcoreVampirismStatLeechPercentage() > 100) {
|
|
|
|
reason.add("Hardcore.Vampirism.Leech_Percentage only accepts values from 0.01 to 100!");
|
2013-07-12 18:49:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Items */
|
|
|
|
if (getChimaeraUseCost() < 1 || getChimaeraUseCost() > 64) {
|
|
|
|
reason.add("Items.Chimaera_Wing.Use_Cost only accepts values from 1 to 64!");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (getChimaeraRecipeCost() < 1 || getChimaeraRecipeCost() > 9) {
|
2013-12-15 22:25:15 +01:00
|
|
|
reason.add("Items.Chimaera_Wing.Recipe_Cost only accepts values from 1 to 9!");
|
2013-07-12 18:49:02 +02:00
|
|
|
}
|
|
|
|
|
2013-09-13 15:12:21 +02:00
|
|
|
if (getChimaeraItem() == null) {
|
|
|
|
reason.add("Items.Chimaera_Wing.Item_Name is invalid!");
|
2013-07-12 18:49:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Particles */
|
|
|
|
if (getLevelUpEffectsTier() < 1) {
|
|
|
|
reason.add("Particles.LevelUp_Tier should be at least 1!");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* PARTY SETTINGS */
|
2013-08-09 13:36:04 +02:00
|
|
|
if (getAutoPartyKickInterval() < -1) {
|
|
|
|
reason.add("Party.AutoKick_Interval should be at least -1!");
|
2013-07-12 18:49:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (getAutoPartyKickTime() < 0) {
|
|
|
|
reason.add("Party.Old_Party_Member_Cutoff should be at least 0!");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (getPartyShareBonusBase() <= 0) {
|
|
|
|
reason.add("Party.Sharing.ExpShare_bonus_base should be greater than 0!");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (getPartyShareBonusIncrease() < 0) {
|
2013-07-24 23:45:31 +02:00
|
|
|
reason.add("Party.Sharing.ExpShare_bonus_increase should be at least 0!");
|
2013-07-12 18:49:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (getPartyShareBonusCap() <= 0) {
|
|
|
|
reason.add("Party.Sharing.ExpShare_bonus_cap should be greater than 0!");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (getPartyShareRange() <= 0) {
|
|
|
|
reason.add("Party.Sharing.Range should be greater than 0!");
|
|
|
|
}
|
|
|
|
|
2013-11-11 17:42:57 +01:00
|
|
|
if (getPartyXpCurveMultiplier() < 1) {
|
|
|
|
reason.add("Party.Leveling.Xp_Curve_Modifier should be at least 1!");
|
|
|
|
}
|
|
|
|
|
|
|
|
for (PartyFeature partyFeature : PartyFeature.values()) {
|
|
|
|
if (getPartyFeatureUnlockLevel(partyFeature) < 0) {
|
|
|
|
reason.add("Party.Leveling." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + "_UnlockLevel should be at least 0!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-12 18:49:02 +02:00
|
|
|
/* Inspect command distance */
|
|
|
|
if (getInspectDistance() <= 0) {
|
|
|
|
reason.add("Commands.inspect.Max_Distance should be greater than 0!");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (getTreeFellerThreshold() <= 0) {
|
|
|
|
reason.add("Abilities.Limits.Tree_Feller_Threshold should be greater than 0!");
|
|
|
|
}
|
|
|
|
|
2018-02-16 00:48:21 +01:00
|
|
|
if (getFishingLureModifier() < 0) {
|
|
|
|
reason.add("Abilities.Fishing.Lure_Modifier should be at least 0!");
|
|
|
|
}
|
|
|
|
|
2013-09-13 15:12:21 +02:00
|
|
|
if (getRepairAnvilMaterial() == null) {
|
|
|
|
reason.add("Skills.Repair.Anvil_Type is invalid!!");
|
2013-07-12 18:49:02 +02:00
|
|
|
}
|
|
|
|
|
2013-09-13 15:12:21 +02:00
|
|
|
if (getSalvageAnvilMaterial() == null) {
|
|
|
|
reason.add("Skills.Repair.Salvage_Anvil_Type is invalid!");
|
2013-07-12 18:49:02 +02:00
|
|
|
}
|
|
|
|
|
2013-09-13 15:12:21 +02:00
|
|
|
if (getRepairAnvilMaterial() == getSalvageAnvilMaterial()) {
|
|
|
|
reason.add("Cannot use the same item for Repair and Salvage anvils!");
|
2013-07-12 18:49:02 +02:00
|
|
|
}
|
|
|
|
|
2019-07-02 08:50:30 +02:00
|
|
|
// if (getTamingCOTWMaterial(EntityType.WOLF) == null) {
|
|
|
|
// reason.add("Skills.Taming.Call_Of_The_Wild.Wolf.Item_Material is invalid!!");
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// if (getTamingCOTWMaterial(EntityType.OCELOT) == null) {
|
|
|
|
// reason.add("Skills.Taming.Call_Of_The_Wild.Ocelot.Item_Material is invalid!!");
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// if (getTamingCOTWMaterial(EntityType.HORSE) == null) {
|
|
|
|
// reason.add("Skills.Taming.Call_Of_The_Wild.Horse.Item_Material is invalid!!");
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// if (getTamingCOTWCost(EntityType.WOLF) <= 0) {
|
|
|
|
// reason.add("Skills.Taming.Call_Of_The_Wild.Wolf.Item_Amount should be greater than 0!");
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// if (getTamingCOTWCost(EntityType.OCELOT) <= 0) {
|
|
|
|
// reason.add("Skills.Taming.Call_Of_The_Wild.Ocelot.Item_Amount should be greater than 0!");
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// if (getTamingCOTWCost(EntityType.HORSE) <= 0) {
|
|
|
|
// reason.add("Skills.Taming.Call_Of_The_Wild.Horse.Item_Amount should be greater than 0!");
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// if (getTamingCOTWAmount(EntityType.WOLF) <= 0) {
|
|
|
|
// reason.add("Skills.Taming.Call_Of_The_Wild.Wolf.Summon_Amount should be greater than 0!");
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// if (getTamingCOTWAmount(EntityType.OCELOT) <= 0) {
|
|
|
|
// reason.add("Skills.Taming.Call_Of_The_Wild.Ocelot.Summon_Amount should be greater than 0!");
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// if (getTamingCOTWAmount(EntityType.HORSE) <= 0) {
|
|
|
|
// reason.add("Skills.Taming.Call_Of_The_Wild.Horse.Summon_Amount should be greater than 0!");
|
|
|
|
// }
|
2013-07-24 23:45:31 +02:00
|
|
|
|
2013-08-20 21:51:12 +02:00
|
|
|
return noErrorsInConfig(reason);
|
2013-07-12 18:49:02 +02:00
|
|
|
}
|
2012-07-03 21:57:24 +02:00
|
|
|
|
2012-04-26 16:32:38 +02:00
|
|
|
/*
|
|
|
|
* GENERAL SETTINGS
|
|
|
|
*/
|
|
|
|
|
2019-04-01 19:16:43 +02:00
|
|
|
public boolean isAprilFoolsAllowed() { return config.getBoolean("General.AprilFoolsEvent", true); }
|
|
|
|
|
2012-04-26 16:32:38 +02:00
|
|
|
/* General Settings */
|
2019-01-16 20:05:43 +01:00
|
|
|
public boolean getIsMetricsEnabled() { return config.getBoolean("Metrics.bstats", true); }
|
|
|
|
|
2019-01-15 07:21:33 +01: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)
|
2019-01-15 07:48:37 +01:00
|
|
|
public boolean getIsRetroMode() { return config.getBoolean("General.RetroMode.Enabled", true); }
|
2018-12-31 19:10:00 +01:00
|
|
|
|
2012-04-27 05:58:21 +02:00
|
|
|
public String getLocale() { return config.getString("General.Locale", "en_us"); }
|
|
|
|
public boolean getMOTDEnabled() { return config.getBoolean("General.MOTD_Enabled", true); }
|
2014-08-01 19:35:36 +02:00
|
|
|
public boolean getShowProfileLoadedMessage() { return config.getBoolean("General.Show_Profile_Loaded", true); }
|
2013-02-01 19:34:33 +01:00
|
|
|
public boolean getDonateMessageEnabled() { return config.getBoolean("Commands.mcmmo.Donate_Message", true); }
|
2012-04-27 05:58:21 +02:00
|
|
|
public int getSaveInterval() { return config.getInt("General.Save_Interval", 10); }
|
2013-09-22 20:33:01 +02:00
|
|
|
public boolean getStatsTrackingEnabled() { return config.getBoolean("General.Stats_Tracking", true); }
|
2013-02-18 22:54:47 +01:00
|
|
|
public boolean getUpdateCheckEnabled() { return config.getBoolean("General.Update_Check", true); }
|
|
|
|
public boolean getPreferBeta() { return config.getBoolean("General.Prefer_Beta", false); }
|
2014-02-28 14:40:00 +01:00
|
|
|
public boolean getVerboseLoggingEnabled() { return config.getBoolean("General.Verbose_Logging", false); }
|
2013-02-24 06:18:01 +01:00
|
|
|
|
2013-09-30 15:43:37 +02:00
|
|
|
public String getPartyChatPrefix() { return config.getString("Commands.partychat.Chat_Prefix_Format", "[[GREEN]]([[WHITE]]{0}[[GREEN]])"); }
|
|
|
|
public boolean getPartyChatColorLeaderName() { return config.getBoolean("Commands.partychat.Gold_Leader_Name", true); }
|
|
|
|
public boolean getPartyDisplayNames() { return config.getBoolean("Commands.partychat.Use_Display_Names", true); }
|
2013-10-28 14:01:44 +01:00
|
|
|
public String getPartyChatPrefixAlly() { return config.getString("Commands.partychat.Chat_Prefix_Format_Ally", "[[GREEN]](A)[[RESET]]"); }
|
2013-08-17 13:53:46 +02:00
|
|
|
|
2013-09-30 15:43:37 +02:00
|
|
|
public String getAdminChatPrefix() { return config.getString("Commands.adminchat.Chat_Prefix_Format", "[[AQUA]][[[WHITE]]{0}[[AQUA]]]"); }
|
|
|
|
public boolean getAdminDisplayNames() { return config.getBoolean("Commands.adminchat.Use_Display_Names", true); }
|
2013-01-14 06:25:31 +01:00
|
|
|
|
2013-09-30 15:43:37 +02:00
|
|
|
public boolean getMatchOfflinePlayers() { return config.getBoolean("Commands.Generic.Match_OfflinePlayers", false); }
|
2014-03-29 17:02:08 +01:00
|
|
|
public long getDatabasePlayerCooldown() { return config.getLong("Commands.Database.Player_Cooldown", 1750); }
|
2013-09-25 14:26:24 +02:00
|
|
|
|
2013-10-31 14:03:29 +01:00
|
|
|
public boolean getLevelUpSoundsEnabled() { return config.getBoolean("General.LevelUp_Sounds", true); }
|
2014-08-18 04:21:23 +02:00
|
|
|
public boolean getRefreshChunksEnabled() { return config.getBoolean("General.Refresh_Chunks", false); }
|
2013-10-31 14:03:29 +01:00
|
|
|
|
2017-10-04 05:32:54 +02:00
|
|
|
public boolean getMobHealthbarEnabled() { return config.getBoolean("Mob_Healthbar.Enabled", true); }
|
|
|
|
|
2013-04-05 04:11:11 +02:00
|
|
|
/* Mob Healthbar */
|
|
|
|
public MobHealthbarType getMobHealthbarDefault() {
|
|
|
|
try {
|
|
|
|
return MobHealthbarType.valueOf(config.getString("Mob_Healthbar.Display_Type", "HEARTS").toUpperCase().trim());
|
|
|
|
}
|
|
|
|
catch (IllegalArgumentException ex) {
|
|
|
|
return MobHealthbarType.HEARTS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getMobHealthbarTime() { return config.getInt("Mob_Healthbar.Display_Time", 3); }
|
|
|
|
|
mcMMO - Now with 100% more scoreboards!
mcMMO now allows for the use of scoreboards to display information in
several instances. By default, all scoreboards are enabled in the config,
and will only display for 10 seconds. After 10 seconds, the scoreboard
will go away and revert to the previously displayed scoreboard, if one
exists.
A global scoreboard now exists for tracking all player stats, and will be
displayed when /mctop is used. Your name will be highlighted in gold when
looking through the scoreboard. Additionally, the scoreboard will display
players in groups of 15, rather than groups of 10 like in chat.
Unfortunately, due to the limitations of scoreboards, the player's rank
will not be displayed in front of their name.
The scoreboard area is now also used for displaying data for /mcrank,
/inspect. and /mcstats. Due to the way scoreboards are handled, the power
level is not guarenteed to show up at any given location in the
scoreboard, but is instead displayed in gold so that it can be easily
found.
Lastly, the scoreboard area is also now used for displaying current data
on skills when the relevant /<skillname> command is used. The effects and
ability stats will still be shown in chat, but the current level, xp, and
remaining xp will be shown in the scoreboard.
2013-04-14 05:16:25 +02:00
|
|
|
/* Scoreboards */
|
2019-01-18 23:20:31 +01:00
|
|
|
public boolean getScoreboardsEnabled() { return config.getBoolean("Scoreboard.UseScoreboards", true); }
|
2014-04-06 13:27:30 +02:00
|
|
|
public boolean getPowerLevelTagsEnabled() { return config.getBoolean("Scoreboard.Power_Level_Tags", false); }
|
|
|
|
public boolean getAllowKeepBoard() { return config.getBoolean("Scoreboard.Allow_Keep", true); }
|
2014-02-09 18:12:00 +01:00
|
|
|
public int getTipsAmount() { return config.getInt("Scoreboard.Tips_Amount", 5); }
|
2014-04-06 13:27:30 +02:00
|
|
|
public boolean getShowStatsAfterLogin() { return config.getBoolean("Scoreboard.Show_Stats_After_Login", false); }
|
|
|
|
public boolean getScoreboardRainbows() { return config.getBoolean("Scoreboard.Rainbows", false); }
|
2014-10-04 14:05:30 +02:00
|
|
|
public boolean getShowAbilityNames() { return config.getBoolean("Scoreboard.Ability_Names", true); }
|
2014-04-06 13:27:30 +02:00
|
|
|
|
2013-09-12 04:42:27 +02:00
|
|
|
public boolean getRankUseChat() { return config.getBoolean("Scoreboard.Types.Rank.Print", false); }
|
2019-01-20 04:18:29 +01:00
|
|
|
public boolean getRankUseBoard() { return config.getBoolean("Scoreboard.Types.Rank.Board", true); }
|
2013-09-12 04:42:27 +02:00
|
|
|
public int getRankScoreboardTime() { return config.getInt("Scoreboard.Types.Rank.Display_Time", 10); }
|
|
|
|
|
|
|
|
public boolean getTopUseChat() { return config.getBoolean("Scoreboard.Types.Top.Print", true); }
|
2019-01-20 04:18:29 +01:00
|
|
|
public boolean getTopUseBoard() { return config.getBoolean("Scoreboard.Types.Top.Board", true); }
|
2013-09-12 04:42:27 +02:00
|
|
|
public int getTopScoreboardTime() { return config.getInt("Scoreboard.Types.Top.Display_Time", 15); }
|
|
|
|
|
|
|
|
public boolean getStatsUseChat() { return config.getBoolean("Scoreboard.Types.Stats.Print", true); }
|
2019-01-20 04:18:29 +01:00
|
|
|
public boolean getStatsUseBoard() { return config.getBoolean("Scoreboard.Types.Stats.Board", true); }
|
2013-09-12 04:42:27 +02:00
|
|
|
public int getStatsScoreboardTime() { return config.getInt("Scoreboard.Types.Stats.Display_Time", 10); }
|
mcMMO - Now with 100% more scoreboards!
mcMMO now allows for the use of scoreboards to display information in
several instances. By default, all scoreboards are enabled in the config,
and will only display for 10 seconds. After 10 seconds, the scoreboard
will go away and revert to the previously displayed scoreboard, if one
exists.
A global scoreboard now exists for tracking all player stats, and will be
displayed when /mctop is used. Your name will be highlighted in gold when
looking through the scoreboard. Additionally, the scoreboard will display
players in groups of 15, rather than groups of 10 like in chat.
Unfortunately, due to the limitations of scoreboards, the player's rank
will not be displayed in front of their name.
The scoreboard area is now also used for displaying data for /mcrank,
/inspect. and /mcstats. Due to the way scoreboards are handled, the power
level is not guarenteed to show up at any given location in the
scoreboard, but is instead displayed in gold so that it can be easily
found.
Lastly, the scoreboard area is also now used for displaying current data
on skills when the relevant /<skillname> command is used. The effects and
ability stats will still be shown in chat, but the current level, xp, and
remaining xp will be shown in the scoreboard.
2013-04-14 05:16:25 +02:00
|
|
|
|
2013-09-12 04:42:27 +02:00
|
|
|
public boolean getInspectUseChat() { return config.getBoolean("Scoreboard.Types.Inspect.Print", true); }
|
2019-01-20 04:18:29 +01:00
|
|
|
public boolean getInspectUseBoard() { return config.getBoolean("Scoreboard.Types.Inspect.Board", true); }
|
2013-09-12 04:42:27 +02:00
|
|
|
public int getInspectScoreboardTime() { return config.getInt("Scoreboard.Types.Inspect.Display_Time", 25); }
|
mcMMO - Now with 100% more scoreboards!
mcMMO now allows for the use of scoreboards to display information in
several instances. By default, all scoreboards are enabled in the config,
and will only display for 10 seconds. After 10 seconds, the scoreboard
will go away and revert to the previously displayed scoreboard, if one
exists.
A global scoreboard now exists for tracking all player stats, and will be
displayed when /mctop is used. Your name will be highlighted in gold when
looking through the scoreboard. Additionally, the scoreboard will display
players in groups of 15, rather than groups of 10 like in chat.
Unfortunately, due to the limitations of scoreboards, the player's rank
will not be displayed in front of their name.
The scoreboard area is now also used for displaying data for /mcrank,
/inspect. and /mcstats. Due to the way scoreboards are handled, the power
level is not guarenteed to show up at any given location in the
scoreboard, but is instead displayed in gold so that it can be easily
found.
Lastly, the scoreboard area is also now used for displaying current data
on skills when the relevant /<skillname> command is used. The effects and
ability stats will still be shown in chat, but the current level, xp, and
remaining xp will be shown in the scoreboard.
2013-04-14 05:16:25 +02:00
|
|
|
|
2013-09-12 04:42:27 +02:00
|
|
|
public boolean getCooldownUseChat() { return config.getBoolean("Scoreboard.Types.Cooldown.Print", false); }
|
2019-01-20 04:18:29 +01:00
|
|
|
public boolean getCooldownUseBoard() { return config.getBoolean("Scoreboard.Types.Cooldown.Board", true); }
|
2013-09-12 04:42:27 +02:00
|
|
|
public int getCooldownScoreboardTime() { return config.getInt("Scoreboard.Types.Cooldown.Display_Time", 41); }
|
mcMMO - Now with 100% more scoreboards!
mcMMO now allows for the use of scoreboards to display information in
several instances. By default, all scoreboards are enabled in the config,
and will only display for 10 seconds. After 10 seconds, the scoreboard
will go away and revert to the previously displayed scoreboard, if one
exists.
A global scoreboard now exists for tracking all player stats, and will be
displayed when /mctop is used. Your name will be highlighted in gold when
looking through the scoreboard. Additionally, the scoreboard will display
players in groups of 15, rather than groups of 10 like in chat.
Unfortunately, due to the limitations of scoreboards, the player's rank
will not be displayed in front of their name.
The scoreboard area is now also used for displaying data for /mcrank,
/inspect. and /mcstats. Due to the way scoreboards are handled, the power
level is not guarenteed to show up at any given location in the
scoreboard, but is instead displayed in gold so that it can be easily
found.
Lastly, the scoreboard area is also now used for displaying current data
on skills when the relevant /<skillname> command is used. The effects and
ability stats will still be shown in chat, but the current level, xp, and
remaining xp will be shown in the scoreboard.
2013-04-14 05:16:25 +02:00
|
|
|
|
2013-09-12 04:42:27 +02:00
|
|
|
public boolean getSkillUseBoard() { return config.getBoolean("Scoreboard.Types.Skill.Board", true); }
|
|
|
|
public int getSkillScoreboardTime() { return config.getInt("Scoreboard.Types.Skill.Display_Time", 30); }
|
2019-01-20 04:18:29 +01:00
|
|
|
public boolean getSkillLevelUpBoard() { return config.getBoolean("Scoreboard.Types.Skill.LevelUp_Board", true); }
|
2013-09-12 04:42:27 +02:00
|
|
|
public int getSkillLevelUpTime() { return config.getInt("Scoreboard.Types.Skill.LevelUp_Time", 5); }
|
mcMMO - Now with 100% more scoreboards!
mcMMO now allows for the use of scoreboards to display information in
several instances. By default, all scoreboards are enabled in the config,
and will only display for 10 seconds. After 10 seconds, the scoreboard
will go away and revert to the previously displayed scoreboard, if one
exists.
A global scoreboard now exists for tracking all player stats, and will be
displayed when /mctop is used. Your name will be highlighted in gold when
looking through the scoreboard. Additionally, the scoreboard will display
players in groups of 15, rather than groups of 10 like in chat.
Unfortunately, due to the limitations of scoreboards, the player's rank
will not be displayed in front of their name.
The scoreboard area is now also used for displaying data for /mcrank,
/inspect. and /mcstats. Due to the way scoreboards are handled, the power
level is not guarenteed to show up at any given location in the
scoreboard, but is instead displayed in gold so that it can be easily
found.
Lastly, the scoreboard area is also now used for displaying current data
on skills when the relevant /<skillname> command is used. The effects and
ability stats will still be shown in chat, but the current level, xp, and
remaining xp will be shown in the scoreboard.
2013-04-14 05:16:25 +02:00
|
|
|
|
2013-01-14 06:25:31 +01:00
|
|
|
/* Database Purging */
|
|
|
|
public int getPurgeInterval() { return config.getInt("Database_Purging.Purge_Interval", -1); }
|
|
|
|
public int getOldUsersCutoff() { return config.getInt("Database_Purging.Old_User_Cutoff", 6); }
|
2012-04-26 16:32:38 +02:00
|
|
|
|
2013-11-01 16:07:56 +01:00
|
|
|
/* Backups */
|
|
|
|
public boolean getBackupsEnabled() { return config.getBoolean("Backups.Enabled", true); }
|
|
|
|
public boolean getKeepLast24Hours() { return config.getBoolean("Backups.Keep.Last_24_Hours", true); }
|
|
|
|
public boolean getKeepDailyLastWeek() { return config.getBoolean("Backups.Keep.Daily_Last_Week", true); }
|
|
|
|
public boolean getKeepWeeklyPastMonth() { return config.getBoolean("Backups.Keep.Weekly_Past_Months", true); }
|
|
|
|
|
2012-04-26 16:32:38 +02:00
|
|
|
/* mySQL */
|
2012-04-27 05:58:21 +02:00
|
|
|
public boolean getUseMySQL() { return config.getBoolean("MySQL.Enabled", false); }
|
|
|
|
public String getMySQLTablePrefix() { return config.getString("MySQL.Database.TablePrefix", "mcmmo_"); }
|
2013-09-30 20:19:07 +02:00
|
|
|
public String getMySQLDatabaseName() { return getStringIncludingInts("MySQL.Database.Name"); }
|
|
|
|
public String getMySQLUserName() { return getStringIncludingInts("MySQL.Database.User_Name"); }
|
2012-04-27 05:58:21 +02:00
|
|
|
public int getMySQLServerPort() { return config.getInt("MySQL.Server.Port", 3306); }
|
|
|
|
public String getMySQLServerName() { return config.getString("MySQL.Server.Address", "localhost"); }
|
2013-09-30 20:19:07 +02:00
|
|
|
public String getMySQLUserPassword() { return getStringIncludingInts("MySQL.Database.User_Password"); }
|
2014-08-19 23:57:52 +02:00
|
|
|
public int getMySQLMaxConnections(PoolIdentifier identifier) { return config.getInt("MySQL.Database.MaxConnections." + StringUtils.getCapitalized(identifier.toString()), 30); }
|
|
|
|
public int getMySQLMaxPoolSize(PoolIdentifier identifier) { return config.getInt("MySQL.Database.MaxPoolSize." + StringUtils.getCapitalized(identifier.toString()), 10); }
|
2019-01-13 02:26:17 +01:00
|
|
|
public boolean getMySQLSSL() { return config.getBoolean("MySQL.Server.SSL", true); }
|
2012-04-30 04:58:54 +02:00
|
|
|
|
2013-09-30 20:19:07 +02:00
|
|
|
private String getStringIncludingInts(String key) {
|
|
|
|
String str = config.getString(key);
|
2013-02-20 22:44:15 +01:00
|
|
|
|
|
|
|
if (str == null) {
|
2013-09-30 20:19:07 +02:00
|
|
|
str = String.valueOf(config.getInt(key));
|
2013-02-20 22:44:15 +01:00
|
|
|
}
|
|
|
|
|
2013-08-06 21:48:09 +02:00
|
|
|
if (str.equals("0")) {
|
2013-01-21 23:22:54 +01:00
|
|
|
str = "No value set for '" + key + "'";
|
2013-02-20 22:44:15 +01:00
|
|
|
}
|
2013-01-21 23:22:54 +01:00
|
|
|
return str;
|
|
|
|
}
|
2012-12-28 11:40:15 +01:00
|
|
|
|
2012-04-30 15:21:14 +02:00
|
|
|
/* Hardcore Mode */
|
2019-01-13 08:54:53 +01:00
|
|
|
public boolean getHardcoreStatLossEnabled(PrimarySkillType primarySkillType) { return config.getBoolean("Hardcore.Death_Stat_Loss.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), false); }
|
|
|
|
public void setHardcoreStatLossEnabled(PrimarySkillType primarySkillType, boolean enabled) { config.set("Hardcore.Death_Stat_Loss.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), enabled); }
|
2013-02-13 14:15:38 +01:00
|
|
|
|
2013-09-13 15:12:21 +02:00
|
|
|
public double getHardcoreDeathStatPenaltyPercentage() { return config.getDouble("Hardcore.Death_Stat_Loss.Penalty_Percentage", 75.0D); }
|
2013-08-21 16:46:38 +02:00
|
|
|
public void setHardcoreDeathStatPenaltyPercentage(double value) { config.set("Hardcore.Death_Stat_Loss.Penalty_Percentage", value); }
|
2013-02-13 14:15:38 +01:00
|
|
|
|
2013-12-15 23:25:17 +01:00
|
|
|
public int getHardcoreDeathStatPenaltyLevelThreshold() { return config.getInt("Hardcore.Death_Stat_Loss.Level_Threshold", 0); }
|
|
|
|
|
2019-01-13 08:54:53 +01:00
|
|
|
public boolean getHardcoreVampirismEnabled(PrimarySkillType primarySkillType) { return config.getBoolean("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), false); }
|
|
|
|
public void setHardcoreVampirismEnabled(PrimarySkillType primarySkillType, boolean enabled) { config.set("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), enabled); }
|
2013-02-13 14:15:38 +01:00
|
|
|
|
2013-09-13 15:12:21 +02:00
|
|
|
public double getHardcoreVampirismStatLeechPercentage() { return config.getDouble("Hardcore.Vampirism.Leech_Percentage", 5.0D); }
|
2013-08-21 16:46:38 +02:00
|
|
|
public void setHardcoreVampirismStatLeechPercentage(double value) { config.set("Hardcore.Vampirism.Leech_Percentage", value); }
|
2012-05-04 20:04:42 +02:00
|
|
|
|
2013-12-15 23:25:17 +01:00
|
|
|
public int getHardcoreVampirismLevelThreshold() { return config.getInt("Hardcore.Vampirism.Level_Threshold", 0); }
|
|
|
|
|
2012-05-04 20:04:42 +02:00
|
|
|
/* SMP Mods */
|
|
|
|
public boolean getToolModsEnabled() { return config.getBoolean("Mods.Tool_Mods_Enabled", false); }
|
2013-10-18 16:16:51 +02:00
|
|
|
public boolean getArmorModsEnabled() { return config.getBoolean("Mods.Armor_Mods_Enabled", false); }
|
2012-05-04 20:04:42 +02:00
|
|
|
public boolean getBlockModsEnabled() { return config.getBoolean("Mods.Block_Mods_Enabled", false); }
|
2013-02-06 04:40:19 +01:00
|
|
|
public boolean getEntityModsEnabled() { return config.getBoolean("Mods.Entity_Mods_Enabled", false); }
|
2012-04-26 16:32:38 +02:00
|
|
|
|
2013-02-15 16:36:14 +01:00
|
|
|
/* Items */
|
2013-03-08 21:46:05 +01:00
|
|
|
public int getChimaeraUseCost() { return config.getInt("Items.Chimaera_Wing.Use_Cost", 1); }
|
|
|
|
public int getChimaeraRecipeCost() { return config.getInt("Items.Chimaera_Wing.Recipe_Cost", 5); }
|
2013-09-13 15:12:21 +02:00
|
|
|
public Material getChimaeraItem() { return Material.matchMaterial(config.getString("Items.Chimaera_Wing.Item_Name", "Feather")); }
|
2013-02-15 16:36:14 +01:00
|
|
|
public boolean getChimaeraEnabled() { return config.getBoolean("Items.Chimaera_Wing.Enabled", true); }
|
2013-03-08 21:46:05 +01:00
|
|
|
public boolean getChimaeraPreventUseUnderground() { return config.getBoolean("Items.Chimaera_Wing.Prevent_Use_Underground", true); }
|
2014-12-18 23:04:38 +01:00
|
|
|
public boolean getChimaeraUseBedSpawn() { return config.getBoolean("Items.Chimaera_Wing.Use_Bed_Spawn", true); }
|
2013-03-08 21:46:05 +01:00
|
|
|
public int getChimaeraCooldown() { return config.getInt("Items.Chimaera_Wing.Cooldown", 240); }
|
2013-03-22 00:38:15 +01:00
|
|
|
public int getChimaeraWarmup() { return config.getInt("Items.Chimaera_Wing.Warmup", 5); }
|
2013-04-10 17:08:27 +02:00
|
|
|
public int getChimaeraRecentlyHurtCooldown() { return config.getInt("Items.Chimaera_Wing.RecentlyHurt_Cooldown", 60); }
|
2013-10-31 14:03:29 +01:00
|
|
|
public boolean getChimaeraSoundEnabled() { return config.getBoolean("Items.Chimaera_Wing.Sound_Enabled", true); }
|
2013-02-15 16:36:14 +01:00
|
|
|
|
2014-12-22 16:58:22 +01:00
|
|
|
public boolean getFluxPickaxeSoundEnabled() { return config.getBoolean("Items.Flux_Pickaxe.Sound_Enabled", true); }
|
|
|
|
|
2013-02-24 19:56:24 +01:00
|
|
|
/* Particles */
|
|
|
|
public boolean getAbilityActivationEffectEnabled() { return config.getBoolean("Particles.Ability_Activation", true); }
|
|
|
|
public boolean getAbilityDeactivationEffectEnabled() { return config.getBoolean("Particles.Ability_Deactivation", true); }
|
|
|
|
public boolean getBleedEffectEnabled() { return config.getBoolean("Particles.Bleed", true); }
|
2014-12-22 16:58:22 +01:00
|
|
|
public boolean getDodgeEffectEnabled() { return config.getBoolean("Particles.Dodge", true); }
|
|
|
|
public boolean getFluxEffectEnabled() { return config.getBoolean("Particles.Flux", true); }
|
2013-02-24 19:56:24 +01:00
|
|
|
public boolean getGreaterImpactEffectEnabled() { return config.getBoolean("Particles.Greater_Impact", true); }
|
2013-09-13 01:22:54 +02:00
|
|
|
public boolean getCallOfTheWildEffectEnabled() { return config.getBoolean("Particles.Call_of_the_Wild", true); }
|
2013-04-02 13:08:07 +02:00
|
|
|
public boolean getLevelUpEffectsEnabled() { return config.getBoolean("Particles.LevelUp_Enabled", true); }
|
|
|
|
public int getLevelUpEffectsTier() { return config.getInt("Particles.LevelUp_Tier", 100); }
|
2019-04-01 19:04:45 +02:00
|
|
|
// public boolean getLargeFireworks() { return config.getBoolean("Particles.LargeFireworks", true); }
|
2013-02-24 19:56:24 +01:00
|
|
|
|
2013-02-04 16:36:47 +01:00
|
|
|
/* PARTY SETTINGS */
|
2019-01-22 00:43:54 +01:00
|
|
|
public boolean getPartyFriendlyFire() { return config.getBoolean("Party.FriendlyFire", false);}
|
2019-01-11 15:17:07 +01:00
|
|
|
public int getPartyMaxSize() {return config.getInt("Party.MaxSize", -1); }
|
2013-02-05 00:42:19 +01:00
|
|
|
public int getAutoPartyKickInterval() { return config.getInt("Party.AutoKick_Interval", 12); }
|
|
|
|
public int getAutoPartyKickTime() { return config.getInt("Party.Old_Party_Member_Cutoff", 7); }
|
2013-11-11 17:42:57 +01:00
|
|
|
|
2013-09-13 15:12:21 +02:00
|
|
|
public double getPartyShareBonusBase() { return config.getDouble("Party.Sharing.ExpShare_bonus_base", 1.1D); }
|
|
|
|
public double getPartyShareBonusIncrease() { return config.getDouble("Party.Sharing.ExpShare_bonus_increase", 0.05D); }
|
|
|
|
public double getPartyShareBonusCap() { return config.getDouble("Party.Sharing.ExpShare_bonus_cap", 1.5D); }
|
|
|
|
public double getPartyShareRange() { return config.getDouble("Party.Sharing.Range", 75.0D); }
|
2013-02-04 16:36:47 +01:00
|
|
|
|
2013-11-11 17:42:57 +01:00
|
|
|
public int getPartyLevelCap() {
|
|
|
|
int cap = config.getInt("Party.Leveling.Level_Cap", 10);
|
|
|
|
return (cap <= 0) ? Integer.MAX_VALUE : cap;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getPartyXpCurveMultiplier() { return config.getInt("Party.Leveling.Xp_Curve_Modifier", 3); }
|
|
|
|
public boolean getPartyXpNearMembersNeeded() { return config.getBoolean("Party.Leveling.Near_Members_Needed", false); }
|
|
|
|
public boolean getPartyInformAllMembers() { return config.getBoolean("Party.Leveling.Inform_All_Party_Members_On_LevelUp", false); }
|
|
|
|
|
|
|
|
public int getPartyFeatureUnlockLevel(PartyFeature partyFeature) { return config.getInt("Party.Leveling." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + "_UnlockLevel", 0); }
|
|
|
|
|
2013-02-01 19:34:33 +01:00
|
|
|
/* Party Teleport Settings */
|
2013-04-10 16:39:37 +02:00
|
|
|
public int getPTPCommandCooldown() { return config.getInt("Commands.ptp.Cooldown", 120); }
|
|
|
|
public int getPTPCommandWarmup() { return config.getInt("Commands.ptp.Warmup", 5); }
|
2013-04-10 17:08:27 +02:00
|
|
|
public int getPTPCommandRecentlyHurtCooldown() { return config.getInt("Commands.ptp.RecentlyHurt_Cooldown", 60); }
|
2013-01-28 21:24:55 +01:00
|
|
|
public int getPTPCommandTimeout() { return config.getInt("Commands.ptp.Request_Timeout", 300); }
|
2014-02-05 19:15:39 +01:00
|
|
|
public boolean getPTPCommandConfirmRequired() { return config.getBoolean("Commands.ptp.Accept_Required", true); }
|
2013-02-04 00:40:29 +01:00
|
|
|
public boolean getPTPCommandWorldPermissions() { return config.getBoolean("Commands.ptp.World_Based_Permissions", false); }
|
2012-04-26 16:32:38 +02:00
|
|
|
|
2013-05-17 01:31:12 +02:00
|
|
|
/* Inspect command distance */
|
2013-09-13 15:12:21 +02:00
|
|
|
public double getInspectDistance() { return config.getDouble("Commands.inspect.Max_Distance", 30.0D); }
|
2013-05-17 01:31:12 +02:00
|
|
|
|
2012-04-26 16:32:38 +02:00
|
|
|
/*
|
|
|
|
* ABILITY SETTINGS
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* General Settings */
|
2019-01-11 11:24:11 +01:00
|
|
|
public boolean getUrlLinksEnabled() { return config.getBoolean("Commands.Skills.URL_Links"); }
|
2012-04-27 05:58:21 +02:00
|
|
|
public boolean getAbilityMessagesEnabled() { return config.getBoolean("Abilities.Messages", true); }
|
|
|
|
public boolean getAbilitiesEnabled() { return config.getBoolean("Abilities.Enabled", true); }
|
|
|
|
public boolean getAbilitiesOnlyActivateWhenSneaking() { return config.getBoolean("Abilities.Activation.Only_Activate_When_Sneaking", false); }
|
2018-12-27 08:59:43 +01:00
|
|
|
public boolean getAbilitiesGateEnabled() { return config.getBoolean("Abilities.Activation.Level_Gate_Abilities"); }
|
2012-04-26 16:32:38 +02:00
|
|
|
|
2019-01-13 04:56:54 +01:00
|
|
|
public int getCooldown(SuperAbilityType ability) { return config.getInt("Abilities.Cooldowns." + ability.toString()); }
|
|
|
|
public int getMaxLength(SuperAbilityType ability) { return config.getInt("Abilities.Max_Seconds." + ability.toString()); }
|
2013-02-20 22:44:15 +01:00
|
|
|
|
2012-04-26 16:32:38 +02:00
|
|
|
/* Durability Settings */
|
2013-10-06 10:08:06 +02:00
|
|
|
public int getAbilityToolDamage() { return config.getInt("Abilities.Tools.Durability_Loss", 1); }
|
2012-04-26 16:32:38 +02:00
|
|
|
|
|
|
|
/* Thresholds */
|
2012-04-27 05:58:21 +02:00
|
|
|
public int getTreeFellerThreshold() { return config.getInt("Abilities.Limits.Tree_Feller_Threshold", 500); }
|
2012-04-26 16:32:38 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* SKILL SETTINGS
|
|
|
|
*/
|
2019-03-30 02:11:32 +01:00
|
|
|
public boolean getDoubleDropsEnabled(PrimarySkillType skill, Material material) { return config.getBoolean("Bonus_Drops." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); }
|
2013-02-20 22:44:15 +01:00
|
|
|
|
2019-01-13 08:54:53 +01:00
|
|
|
public boolean getDoubleDropsDisabled(PrimarySkillType skill) {
|
2013-02-20 22:44:15 +01:00
|
|
|
String skillName = StringUtils.getCapitalized(skill.toString());
|
2019-03-30 02:11:32 +01:00
|
|
|
ConfigurationSection section = config.getConfigurationSection("Bonus_Drops." + skillName);
|
2015-09-27 00:50:26 +02:00
|
|
|
if (section == null)
|
|
|
|
return false;
|
2013-02-20 22:44:15 +01:00
|
|
|
Set<String> keys = section.getKeys(false);
|
|
|
|
boolean disabled = true;
|
|
|
|
|
|
|
|
for (String key : keys) {
|
2019-03-30 02:11:32 +01:00
|
|
|
if (config.getBoolean("Bonus_Drops." + skillName + "." + key)) {
|
2013-02-20 22:44:15 +01:00
|
|
|
disabled = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return disabled;
|
|
|
|
}
|
2012-04-26 16:32:38 +02:00
|
|
|
|
2018-12-27 08:59:43 +01:00
|
|
|
/* Axes */
|
|
|
|
public int getAxesGate() { return config.getInt("Skills.Axes.Ability_Activation_Level_Gate", 10); }
|
|
|
|
|
2013-02-20 22:44:15 +01:00
|
|
|
/* Acrobatics */
|
|
|
|
public boolean getDodgeLightningDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_Dodge_Lightning", false); }
|
2014-03-09 15:24:24 +01:00
|
|
|
public int getXPAfterTeleportCooldown() { return config.getInt("Skills.Acrobatics.XP_After_Teleport_Cooldown", 5); }
|
2012-04-26 16:32:38 +02:00
|
|
|
|
2013-11-16 00:21:00 +01:00
|
|
|
/* Alchemy */
|
|
|
|
public boolean getEnabledForHoppers() { return config.getBoolean("Skills.Alchemy.Enabled_for_Hoppers", true); }
|
2014-04-27 15:03:07 +02:00
|
|
|
public boolean getPreventHopperTransferIngredients() { return config.getBoolean("Skills.Alchemy.Prevent_Hopper_Transfer_Ingredients", false); }
|
|
|
|
public boolean getPreventHopperTransferBottles() { return config.getBoolean("Skills.Alchemy.Prevent_Hopper_Transfer_Bottles", false); }
|
2013-11-16 00:21:00 +01:00
|
|
|
|
2012-04-26 16:32:38 +02:00
|
|
|
/* Fishing */
|
2013-01-11 00:21:18 +01:00
|
|
|
public boolean getFishingDropsEnabled() { return config.getBoolean("Skills.Fishing.Drops_Enabled", true); }
|
2014-02-15 11:55:36 +01:00
|
|
|
public boolean getFishingOverrideTreasures() { return config.getBoolean("Skills.Fishing.Override_Vanilla_Treasures", true); }
|
2014-02-15 11:43:54 +01:00
|
|
|
public boolean getFishingExtraFish() { return config.getBoolean("Skills.Fishing.Extra_Fish", true); }
|
2018-02-16 00:48:21 +01:00
|
|
|
public double getFishingLureModifier() { return config.getDouble("Skills.Fishing.Lure_Modifier", 4.0D); }
|
2012-04-26 16:32:38 +02:00
|
|
|
|
|
|
|
/* Mining */
|
2019-04-04 09:39:00 +02:00
|
|
|
public Material getDetonatorItem() { return Material.matchMaterial(config.getString("Skills.Mining.Detonator_Name", "FLINT_AND_STEEL")); }
|
2018-12-27 08:59:43 +01:00
|
|
|
|
|
|
|
/* Excavation */
|
|
|
|
public int getExcavationGate() { return config.getInt("Skills.Excavation.Ability_Activation_Level_Gate", 10); }
|
2012-04-26 16:32:38 +02:00
|
|
|
|
|
|
|
/* Repair */
|
2012-04-27 05:58:21 +02:00
|
|
|
public boolean getRepairAnvilMessagesEnabled() { return config.getBoolean("Skills.Repair.Anvil_Messages", true); }
|
2013-10-31 14:03:29 +01:00
|
|
|
public boolean getRepairAnvilPlaceSoundsEnabled() { return config.getBoolean("Skills.Repair.Anvil_Placed_Sounds", true); }
|
|
|
|
public boolean getRepairAnvilUseSoundsEnabled() { return config.getBoolean("Skills.Repair.Anvil_Use_Sounds", true); }
|
2013-09-13 15:12:21 +02:00
|
|
|
public Material getRepairAnvilMaterial() { return Material.matchMaterial(config.getString("Skills.Repair.Anvil_Material", "IRON_BLOCK")); }
|
2013-04-25 23:29:49 +02:00
|
|
|
public boolean getRepairConfirmRequired() { return config.getBoolean("Skills.Repair.Confirm_Required", true); }
|
2012-04-27 05:58:21 +02:00
|
|
|
|
2013-03-06 18:31:48 +01:00
|
|
|
/* Salvage */
|
|
|
|
public boolean getSalvageAnvilMessagesEnabled() { return config.getBoolean("Skills.Salvage.Anvil_Messages", true); }
|
2013-12-14 14:27:50 +01:00
|
|
|
public boolean getSalvageAnvilPlaceSoundsEnabled() { return config.getBoolean("Skills.Salvage.Anvil_Placed_Sounds", true); }
|
|
|
|
public boolean getSalvageAnvilUseSoundsEnabled() { return config.getBoolean("Skills.Salvage.Anvil_Use_Sounds", true); }
|
|
|
|
public Material getSalvageAnvilMaterial() { return Material.matchMaterial(config.getString("Skills.Salvage.Anvil_Material", "GOLD_BLOCK")); }
|
|
|
|
public boolean getSalvageConfirmRequired() { return config.getBoolean("Skills.Salvage.Confirm_Required", true); }
|
2013-03-06 18:31:48 +01:00
|
|
|
|
2013-02-14 06:34:50 +01:00
|
|
|
/* Unarmed */
|
|
|
|
public boolean getUnarmedBlockCrackerSmoothbrickToCracked() { return config.getBoolean("Skills.Unarmed.Block_Cracker.SmoothBrick_To_CrackedBrick", true); }
|
2014-07-15 15:40:49 +02:00
|
|
|
public boolean getUnarmedItemPickupDisabled() { return config.getBoolean("Skills.Unarmed.Item_Pickup_Disabled_Full_Inventory", true); }
|
2014-12-29 06:12:46 +01:00
|
|
|
public boolean getUnarmedItemsAsUnarmed() { return config.getBoolean("Skills.Unarmed.Items_As_Unarmed", false); }
|
2018-12-27 08:59:43 +01:00
|
|
|
public int getUnarmedGate() { return config.getInt("Skills.Unarmed.Ability_Activation_Level_Gate", 10); }
|
|
|
|
|
|
|
|
/* Swords */
|
|
|
|
public int getSwordsGate() { return config.getInt("Skills.Swords.Ability_Activation_Level_Gate", 10); }
|
2013-02-14 06:34:50 +01:00
|
|
|
|
2012-04-26 16:32:38 +02:00
|
|
|
/* Taming */
|
2019-07-02 08:50:30 +02:00
|
|
|
// public Material getTamingCOTWMaterial(EntityType type) { return Material.matchMaterial(config.getString("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Material")); }
|
|
|
|
// public int getTamingCOTWCost(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Amount"); }
|
|
|
|
// public int getTamingCOTWAmount(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Summon_Amount"); }
|
|
|
|
// public int getTamingCOTWLength(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type)+ ".Summon_Length"); }
|
|
|
|
// public int getTamingCOTWMaxAmount(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type)+ ".Summon_Max_Amount"); }
|
|
|
|
|
|
|
|
public Material getTamingCOTWMaterial(String cotwEntity) { return Material.matchMaterial(config.getString("Skills.Taming.Call_Of_The_Wild." + cotwEntity + ".Item_Material")); }
|
|
|
|
public int getTamingCOTWCost(String cotwEntity) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + cotwEntity + ".Item_Amount"); }
|
|
|
|
public int getTamingCOTWAmount(String cotwEntity) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + cotwEntity + ".Summon_Amount"); }
|
|
|
|
public int getTamingCOTWLength(String cotwEntity) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + cotwEntity+ ".Summon_Length"); }
|
|
|
|
public int getTamingCOTWMaxAmount(String cotwEntity) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + cotwEntity+ ".Per_Player_Limit", 1); }
|
2012-04-26 16:32:38 +02:00
|
|
|
|
|
|
|
/* Woodcutting */
|
2019-03-30 02:11:32 +01:00
|
|
|
public boolean getWoodcuttingDoubleDropsEnabled(BlockData material) { return config.getBoolean("Bonus_Drops.Woodcutting." + StringUtils.getFriendlyConfigBlockDataString(material)); }
|
2013-10-31 14:03:29 +01:00
|
|
|
public boolean getTreeFellerSoundsEnabled() { return config.getBoolean("Skills.Woodcutting.Tree_Feller_Sounds", true); }
|
2018-12-27 08:59:43 +01:00
|
|
|
public int getWoodcuttingGate() { return config.getInt("Skills.Woodcutting.Ability_Activation_Level_Gate", 10); }
|
2012-05-01 07:14:32 +02:00
|
|
|
|
2012-11-08 03:41:18 +01:00
|
|
|
/* AFK Leveling */
|
2013-10-28 15:39:47 +01:00
|
|
|
public boolean getHerbalismPreventAFK() { return config.getBoolean("Skills.Herbalism.Prevent_AFK_Leveling", true); }
|
2012-11-08 03:41:18 +01:00
|
|
|
|
2012-04-26 16:32:38 +02:00
|
|
|
/* Level Caps */
|
2013-02-20 22:44:15 +01:00
|
|
|
public int getPowerLevelCap() {
|
|
|
|
int cap = config.getInt("General.Power_Level_Cap", 0);
|
|
|
|
return (cap <= 0) ? Integer.MAX_VALUE : cap;
|
2012-12-27 22:45:27 +01:00
|
|
|
}
|
|
|
|
|
2019-01-13 08:54:53 +01:00
|
|
|
public int getLevelCap(PrimarySkillType skill) {
|
2013-02-20 22:44:15 +01:00
|
|
|
int cap = config.getInt("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Level_Cap");
|
|
|
|
return (cap <= 0) ? Integer.MAX_VALUE : cap;
|
2012-12-27 04:54:20 +01:00
|
|
|
}
|
2012-04-26 16:32:38 +02:00
|
|
|
|
2019-01-15 11:43:44 +01:00
|
|
|
|
|
|
|
/*public int isSuperAbilityUnlocked(PrimarySkillType skill) {
|
2018-12-27 08:59:43 +01:00
|
|
|
return config.getInt("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Ability_Activation_Level_Gate");
|
2019-01-15 11:43:44 +01:00
|
|
|
}*/
|
2018-12-27 08:59:43 +01:00
|
|
|
|
2015-11-13 01:10:09 +01:00
|
|
|
public boolean getTruncateSkills() { return config.getBoolean("General.TruncateSkills", false); }
|
|
|
|
|
2012-05-02 04:42:45 +02:00
|
|
|
/* PVP & PVE Settings */
|
2019-01-13 08:54:53 +01:00
|
|
|
public boolean getPVPEnabled(PrimarySkillType skill) { return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVP", true); }
|
|
|
|
public boolean getPVEEnabled(PrimarySkillType skill) { return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVE", true); }
|
2016-03-11 15:20:23 +01:00
|
|
|
|
2019-01-13 04:08:54 +01:00
|
|
|
//public float getMasterVolume() { return (float) config.getDouble("Sounds.MasterVolume", 1.0); }
|
2019-05-16 20:34:26 +02:00
|
|
|
|
|
|
|
public boolean broadcastEventMessages() { return config.getBoolean("General.EventBroadcasts", true);}
|
2019-05-16 20:40:47 +02:00
|
|
|
public boolean playerJoinEventInfo() { return config.getBoolean("General.EventInfoOnPlayerJoin", true);}
|
2019-05-18 19:09:45 +02:00
|
|
|
public boolean adminNotifications() { return config.getBoolean("General.AdminNotifications", true);}
|
|
|
|
|
2012-05-01 19:52:44 +02:00
|
|
|
}
|