2012-11-21 21:49:54 +01:00
package com.gmail.nossr50.config ;
2019-01-08 19:52:52 -08:00
import com.gmail.nossr50.datatypes.interactions.NotificationType ;
import com.gmail.nossr50.datatypes.skills.SubSkillType ;
import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill ;
2019-01-23 15:06:00 -08:00
import com.gmail.nossr50.mcMMO ;
2019-01-08 19:52:52 -08:00
import net.md_5.bungee.api.ChatColor ;
2019-02-12 06:17:27 -08:00
import ninja.leaping.configurate.objectmapping.Setting ;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable ;
2013-10-01 08:57:21 -04:00
2019-01-14 22:11:58 -08:00
import java.util.ArrayList ;
import java.util.List ;
2019-02-12 06:17:27 -08:00
@ConfigSerializable
2019-02-12 01:31:51 -08:00
public class AdvancedConfig extends ConfigLoaderConfigurable {
2012-11-21 21:49:54 +01:00
private static AdvancedConfig instance ;
2012-12-24 16:56:25 -05:00
2012-11-21 21:49:54 +01:00
private AdvancedConfig ( ) {
2019-02-12 01:31:51 -08:00
super ( mcMMO . p . getDataFolder ( ) , " advanced.yml " ) ;
2012-11-21 21:49:54 +01:00
}
2013-01-26 23:01:55 +01:00
2012-11-21 21:49:54 +01:00
public static AdvancedConfig getInstance ( ) {
if ( instance = = null ) {
instance = new AdvancedConfig ( ) ;
}
2013-01-26 23:01:55 +01:00
2012-11-21 21:49:54 +01:00
return instance ;
}
2012-12-24 16:56:25 -05:00
2019-02-12 06:17:27 -08:00
@Setting ( value = " Skills.General.StartingLevel " , comment = " The starting level for players on your server. \ nHistorically this has been 0. \ nRecently is has changed to 1. " )
private int startingLevel = 1 ;
2012-11-25 16:40:42 -08:00
@Override
2019-02-12 01:31:51 -08:00
public List < String > validateKeys ( ) {
2013-07-29 00:37:13 +02:00
// Validate all the settings!
List < String > reason = new ArrayList < String > ( ) ;
/* GENERAL */
2019-01-23 15:06:00 -08:00
if ( getAbilityLength ( ) < 1 ) {
reason . add ( " Skills.General.Ability.Length.<mode>.IncreaseLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getEnchantBuff ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.General.Ability.EnchantBuff should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
/* ACROBATICS */
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . ACROBATICS_DODGE ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Acrobatics.Dodge.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-08 19:52:52 -08:00
if ( getMaxBonusLevel ( SubSkillType . ACROBATICS_DODGE ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Acrobatics.Dodge.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getDodgeDamageModifier ( ) < = 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Acrobatics.Dodge.DamageModifier should be greater than 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . ACROBATICS_ROLL ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Acrobatics.Roll.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-08 19:52:52 -08:00
if ( getMaxBonusLevel ( SubSkillType . ACROBATICS_ROLL ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Acrobatics.Roll.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getRollDamageThreshold ( ) < 0 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Acrobatics.Roll.DamageThreshold should be at least 0! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getGracefulRollDamageThreshold ( ) < 0 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Acrobatics.GracefulRoll.DamageThreshold should be at least 0! " ) ;
2013-07-29 00:37:13 +02:00
}
2013-11-15 18:21:00 -05:00
if ( getCatalysisMinSpeed ( ) < = 0 ) {
reason . add ( " Skills.Alchemy.Catalysis.MinSpeed must be greater than 0! " ) ;
}
2014-01-18 11:50:42 +01:00
2013-11-15 18:21:00 -05:00
if ( getCatalysisMaxSpeed ( ) < getCatalysisMinSpeed ( ) ) {
reason . add ( " Skills.Alchemy.Catalysis.MaxSpeed should be at least Skills.Alchemy.Catalysis.MinSpeed! " ) ;
}
2013-07-29 00:37:13 +02:00
/* ARCHERY */
2019-01-03 04:32:46 -08:00
if ( getSkillShotRankDamageMultiplier ( ) < = 0 ) {
reason . add ( " Skills.Archery.SkillShot.RankDamageMultiplier should be greater than 0! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . ARCHERY_DAZE ) < 1 ) {
2019-01-04 07:58:39 -08:00
reason . add ( " Skills.Archery.Daze.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-08 19:52:52 -08:00
if ( getMaxBonusLevel ( SubSkillType . ARCHERY_DAZE ) < 1 ) {
2019-01-04 07:58:39 -08:00
reason . add ( " Skills.Archery.Daze.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2014-06-29 16:38:40 +02:00
if ( getDazeBonusDamage ( ) < 0 ) {
2019-01-04 07:58:39 -08:00
reason . add ( " Skills.Archery.Daze.BonusDamage should be at least 0! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . ARCHERY_ARROW_RETRIEVAL ) < 1 ) {
2019-01-04 07:58:39 -08:00
reason . add ( " Skills.Archery.Retrieve.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-08 19:52:52 -08:00
if ( getMaxBonusLevel ( SubSkillType . ARCHERY_ARROW_RETRIEVAL ) < 1 ) {
2019-01-04 07:58:39 -08:00
reason . add ( " Skills.Archery.Retrieve.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getForceMultiplier ( ) < 0 ) {
2019-01-04 07:58:39 -08:00
reason . add ( " Skills.Archery.ForceMultiplier should be at least 0! " ) ;
2013-07-29 00:37:13 +02:00
}
/* AXES */
2019-01-03 04:32:46 -08:00
if ( getAxeMasteryRankDamageMultiplier ( ) < 0 )
{
reason . add ( " Skills.Axes.AxeMastery.RankDamageMultiplier should be at least 0! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . AXES_CRITICAL_STRIKES ) < 1 ) {
2013-11-22 12:32:23 -05:00
reason . add ( " Skills.Axes.CriticalHit.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-08 19:52:52 -08:00
if ( getMaxBonusLevel ( SubSkillType . AXES_CRITICAL_STRIKES ) < 1 ) {
2013-11-22 12:32:23 -05:00
reason . add ( " Skills.Axes.CriticalHit.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-04 07:58:39 -08:00
if ( getCriticalStrikesPVPModifier ( ) < 1 ) {
reason . add ( " Skills.Axes.CriticalStrikes.PVP_Modifier should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-04 07:58:39 -08:00
if ( getCriticalStrikesPVPModifier ( ) < 1 ) {
reason . add ( " Skills.Axes.CriticalStrikes.PVE_Modifier should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getGreaterImpactChance ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Axes.GreaterImpact.Chance should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getGreaterImpactModifier ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Axes.GreaterImpact.KnockbackModifier should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getGreaterImpactBonusDamage ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Axes.GreaterImpact.BonusDamage should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getArmorImpactIncreaseLevel ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Axes.ArmorImpact.IncreaseLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getImpactChance ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Axes.ArmorImpact.Chance should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getArmorImpactMaxDurabilityDamage ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Axes.ArmorImpact.MaxPercentageDurabilityDamage should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getSkullSplitterModifier ( ) < 1 ) {
2014-10-30 23:48:03 +00:00
reason . add ( " Skills.Axes.SkullSplitter.DamageModifier should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getFishermanDietRankChange ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Fishing.FishermansDiet.RankChange should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2013-10-10 19:12:25 +02:00
if ( getMasterAnglerBoatModifier ( ) < 1 ) {
reason . add ( " Skills.Fishing.MasterAngler.BoatModifier should be at least 1! " ) ;
}
if ( getMasterAnglerBiomeModifier ( ) < 1 ) {
reason . add ( " Skills.Fishing.MasterAngler.BiomeModifier should be at least 1! " ) ;
}
2013-07-29 00:37:13 +02:00
/* HERBALISM */
if ( getFarmerDietRankChange ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Herbalism.FarmersDiet.RankChange should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getGreenThumbStageChange ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Herbalism.GreenThumb.StageChange should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . HERBALISM_GREEN_THUMB ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Herbalism.GreenThumb.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-08 19:52:52 -08:00
if ( getMaxBonusLevel ( SubSkillType . HERBALISM_GREEN_THUMB ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Herbalism.GreenThumb.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . HERBALISM_DOUBLE_DROPS ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Herbalism.DoubleDrops.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-08 19:52:52 -08:00
if ( getMaxBonusLevel ( SubSkillType . HERBALISM_DOUBLE_DROPS ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Herbalism.DoubleDrops.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . HERBALISM_HYLIAN_LUCK ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Herbalism.HylianLuck.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-08 19:52:52 -08:00
if ( getMaxBonusLevel ( SubSkillType . HERBALISM_HYLIAN_LUCK ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Herbalism.HylianLuck.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . HERBALISM_SHROOM_THUMB ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Herbalism.ShroomThumb.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-08 19:52:52 -08:00
if ( getMaxBonusLevel ( SubSkillType . HERBALISM_SHROOM_THUMB ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Herbalism.ShroomThumb.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
/* MINING */
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . MINING_DOUBLE_DROPS ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Mining.DoubleDrops.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-08 19:52:52 -08:00
if ( getMaxBonusLevel ( SubSkillType . MINING_DOUBLE_DROPS ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Mining.DoubleDrops.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
/* REPAIR */
if ( getRepairMasteryMaxBonus ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Repair.RepairMastery.MaxBonusPercentage should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getRepairMasteryMaxLevel ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Repair.RepairMastery.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . REPAIR_SUPER_REPAIR ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Repair.SuperRepair.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-08 19:52:52 -08:00
if ( getMaxBonusLevel ( SubSkillType . REPAIR_SUPER_REPAIR ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Repair.SuperRepair.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
/* SMELTING */
if ( getBurnModifierMaxLevel ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Smelting.FuelEfficiency.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-08 19:52:52 -08:00
if ( getMaxBonusLevel ( SubSkillType . SMELTING_SECOND_SMELT ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Smelting.SecondSmelt.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . SMELTING_SECOND_SMELT ) < 1 ) {
2013-10-11 16:22:30 +02:00
reason . add ( " Skills.Smelting.SecondSmelt.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getFluxMiningChance ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Smelting.FluxMining.Chance should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
/* SWORDS */
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . SWORDS_RUPTURE ) < 1 ) {
2019-01-21 15:14:01 -08:00
reason . add ( " Skills.Swords.Rupture.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-21 15:14:01 -08:00
if ( getMaxBonusLevel ( SubSkillType . SWORDS_RUPTURE ) < 1 ) {
reason . add ( " Skills.Swords.Rupture.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-21 15:14:01 -08:00
if ( getRuptureMaxTicks ( ) < 1 ) {
reason . add ( " Skills.Swords.Rupture.MaxTicks should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-21 15:14:01 -08:00
if ( getRuptureMaxTicks ( ) < getRuptureBaseTicks ( ) ) {
reason . add ( " Skills.Swords.Rupture.MaxTicks should be at least Skills.Swords.Rupture.BaseTicks! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-21 15:14:01 -08:00
if ( getRuptureBaseTicks ( ) < 1 ) {
reason . add ( " Skills.Swords.Rupture.BaseTicks should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . SWORDS_COUNTER_ATTACK ) < 1 ) {
2019-01-04 07:58:39 -08:00
reason . add ( " Skills.Swords.CounterAttack.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-08 19:52:52 -08:00
if ( getMaxBonusLevel ( SubSkillType . SWORDS_COUNTER_ATTACK ) < 1 ) {
2019-01-04 07:58:39 -08:00
reason . add ( " Skills.Swords.CounterAttack.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getCounterModifier ( ) < 1 ) {
2019-01-04 07:58:39 -08:00
reason . add ( " Skills.Swords.CounterAttack.DamageModifier should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getSerratedStrikesModifier ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Swords.SerratedStrikes.DamageModifier should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getSerratedStrikesTicks ( ) < 1 ) {
2019-01-21 15:14:01 -08:00
reason . add ( " Skills.Swords.SerratedStrikes.RuptureTicks should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
/* TAMING */
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . TAMING_GORE ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Taming.Gore.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-08 19:52:52 -08:00
if ( getMaxBonusLevel ( SubSkillType . TAMING_GORE ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Taming.Gore.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getGoreModifier ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Taming.Gore.Modifier should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getFastFoodChance ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Taming.FastFood.Chance should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getThickFurModifier ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Taming.ThickFur.Modifier should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getShockProofModifier ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Taming.ShockProof.Modifier should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
if ( getSharpenedClawsBonus ( ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Taming.SharpenedClaws.Bonus should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2013-11-10 13:54:45 -05:00
if ( getMaxHorseJumpStrength ( ) < 0 | | getMaxHorseJumpStrength ( ) > 2 ) {
reason . add ( " Skills.Taming.CallOfTheWild.MaxHorseJumpStrength should be between 0 and 2! " ) ;
}
2013-07-29 00:37:13 +02:00
/* UNARMED */
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . UNARMED_DISARM ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Unarmed.Disarm.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-08 19:52:52 -08:00
if ( getMaxBonusLevel ( SubSkillType . UNARMED_DISARM ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Unarmed.Disarm.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . UNARMED_ARROW_DEFLECT ) < 1 ) {
2019-01-04 07:58:39 -08:00
reason . add ( " Skills.Unarmed.ArrowDeflect.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-08 19:52:52 -08:00
if ( getMaxBonusLevel ( SubSkillType . UNARMED_ARROW_DEFLECT ) < 1 ) {
2019-01-04 07:58:39 -08:00
reason . add ( " Skills.Unarmed.ArrowDeflect.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . UNARMED_IRON_GRIP ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Unarmed.IronGrip.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-08 19:52:52 -08:00
if ( getMaxBonusLevel ( SubSkillType . UNARMED_IRON_GRIP ) < 1 ) {
2013-10-01 17:01:11 +02:00
reason . add ( " Skills.Unarmed.IronGrip.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
/* WOODCUTTING */
2018-12-31 10:10:00 -08:00
2019-01-17 08:46:10 -08:00
/ * if ( getLeafBlowUnlockLevel ( ) < 0 ) {
2014-01-17 15:51:28 +01:00
reason . add ( " Skills.Woodcutting.LeafBlower.UnlockLevel should be at least 0! " ) ;
2019-01-17 08:46:10 -08:00
} * /
2013-07-29 00:37:13 +02:00
2019-01-24 15:23:39 -08:00
if ( getMaximumProbability ( SubSkillType . WOODCUTTING_HARVEST_LUMBER ) < 1 ) {
2018-12-31 10:10:00 -08:00
reason . add ( " Skills.Woodcutting.HarvestLumber.ChanceMax should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-01-08 19:52:52 -08:00
if ( getMaxBonusLevel ( SubSkillType . WOODCUTTING_HARVEST_LUMBER ) < 1 ) {
2018-12-31 10:10:00 -08:00
reason . add ( " Skills.Woodcutting.HarvestLumber.MaxBonusLevel should be at least 1! " ) ;
2013-07-29 00:37:13 +02:00
}
2019-02-12 01:31:51 -08:00
return reason ;
2013-07-29 00:37:13 +02:00
}
2013-02-22 13:39:47 -05:00
2012-11-25 16:40:42 -08:00
/* GENERAL */
2019-02-12 06:17:27 -08:00
public int getStartingLevel ( ) { return startingLevel ; }
2019-01-23 15:06:00 -08:00
/ * *
* This returns the maximum level at which superabilities will stop lengthening from scaling alongside skill level .
* It returns a different value depending on whether or not the server is in retro mode
* @return the level at which abilities stop increasing in length
* /
public int getAbilityLengthCap ( ) {
if ( ! mcMMO . isRetroModeEnabled ( ) )
2019-02-12 01:52:20 -08:00
return getIntValue ( " Skills.General.Ability.Length.Standard.CapLevel " ) ;
2019-01-23 15:06:00 -08:00
else
2019-02-12 01:52:20 -08:00
return getIntValue ( " Skills.General.Ability.Length.RetroMode.CapLevel " ) ;
2019-01-23 15:06:00 -08:00
}
/ * *
* This returns the frequency at which abilities will increase in length
* It returns a different value depending on whether or not the server is in retro mode
* @return the number of levels required per ability length increase
* /
public int getAbilityLength ( ) {
if ( ! mcMMO . isRetroModeEnabled ( ) )
2019-02-12 01:52:20 -08:00
return getIntValue ( " Skills.General.Ability.Length.Standard.IncreaseLevel " ) ;
2019-01-23 15:06:00 -08:00
else
2019-02-12 01:52:20 -08:00
return getIntValue ( " Skills.General.Ability.Length.RetroMode.IncreaseLevel " ) ;
2019-01-23 15:06:00 -08:00
}
2019-02-12 01:52:20 -08:00
public int getEnchantBuff ( ) { return getIntValue ( " Skills.General.Ability.EnchantBuff " ) ; }
2012-12-24 16:56:25 -05:00
2019-01-23 15:06:00 -08:00
/ * *
* Grabs the max bonus level for a skill used in RNG calculations
* All max level values in the config are multiplied by 10 if the server is in retro mode as the values in the config are based around the new 1 - 100 skill system scaling
* A value of 10 in the file will be returned as 100 for retro mode servers to accommodate the change in scaling
* @param subSkillType target subskill
* @return the level at which this skills max benefits will be reached on the curve
* /
public int getMaxBonusLevel ( SubSkillType subSkillType ) {
2019-02-04 21:56:57 -08:00
String keyPath = subSkillType . getAdvConfigAddress ( ) + " .MaxBonusLevel. " ;
2019-02-12 01:52:20 -08:00
return mcMMO . isRetroModeEnabled ( ) ? getIntValue ( keyPath + " RetroMode " ) : getIntValue ( keyPath + " Standard " ) ;
2019-01-23 15:06:00 -08:00
}
2019-01-08 19:52:52 -08:00
public int getMaxBonusLevel ( AbstractSubSkill abstractSubSkill ) {
2019-02-04 21:56:57 -08:00
return getMaxBonusLevel ( abstractSubSkill . getSubSkillType ( ) ) ;
2019-01-08 19:52:52 -08:00
}
2019-01-24 15:23:39 -08:00
public double getMaximumProbability ( SubSkillType subSkillType ) {
2019-02-12 01:52:20 -08:00
double maximumProbability = getDoubleValue ( subSkillType . getAdvConfigAddress ( ) + " .ChanceMax " ) ;
2019-01-24 15:23:39 -08:00
return maximumProbability ;
}
public double getMaximumProbability ( AbstractSubSkill abstractSubSkill )
2019-01-08 19:52:52 -08:00
{
2019-02-04 21:56:57 -08:00
return getMaximumProbability ( abstractSubSkill . getSubSkillType ( ) ) ;
2019-01-08 19:52:52 -08:00
}
2019-01-14 01:22:14 -08:00
/* Notification Settings */
2019-01-26 08:14:06 -08:00
public boolean doesSkillCommandSendBlankLines ( )
{
2019-02-12 01:52:20 -08:00
return getBooleanValue ( " Feedback.SkillCommand.BlankLinesAboveHeader " ) ;
2019-01-26 08:14:06 -08:00
}
2019-01-08 19:52:52 -08:00
public boolean doesNotificationUseActionBar ( NotificationType notificationType )
{
2019-02-12 01:52:20 -08:00
return getBooleanValue ( " Feedback.ActionBarNotifications. " + notificationType . toString ( ) + " .Enabled " ) ;
2019-01-14 01:22:14 -08:00
}
public boolean doesNotificationSendCopyToChat ( NotificationType notificationType )
{
2019-02-12 01:52:20 -08:00
return getBooleanValue ( " Feedback.ActionBarNotifications. " + notificationType . toString ( ) + " .SendCopyOfMessageToChat " ) ;
2019-01-08 19:52:52 -08:00
}
2019-01-14 02:32:02 -08:00
public boolean useTitlesForXPEvent ( )
{
2019-02-12 01:52:20 -08:00
return getBooleanValue ( " Feedback.Events.XP.SendTitles " ) ;
2019-01-08 19:52:52 -08:00
}
private ChatColor getChatColorFromKey ( String keyLocation ) {
2019-02-12 01:52:20 -08:00
String colorName = getStringValue ( keyLocation ) ;
2019-01-08 19:52:52 -08:00
2019-01-11 05:26:05 -08:00
return getChatColor ( colorName ) ;
}
private ChatColor getChatColor ( String configColor ) {
2019-01-08 19:52:52 -08:00
for ( ChatColor chatColor : ChatColor . values ( ) ) {
2019-01-11 05:26:05 -08:00
if ( configColor . equalsIgnoreCase ( chatColor . getName ( ) ) )
2019-01-08 19:52:52 -08:00
return chatColor ;
}
//Invalid Color
2019-01-11 05:26:05 -08:00
System . out . println ( " [mcMMO] " + configColor + " is an invalid color value " ) ;
2019-01-08 19:52:52 -08:00
return ChatColor . WHITE ;
}
2018-12-31 10:10:00 -08:00
/ * *
* Some SubSkills have the ability to retain classic functionality
2019-01-08 19:52:52 -08:00
* @param subSkillType SubSkillType with classic functionality
2018-12-31 10:10:00 -08:00
* @return true if the subskill is in classic mode
* /
2019-01-08 19:52:52 -08:00
public boolean isSubSkillClassic ( SubSkillType subSkillType )
2018-12-31 10:10:00 -08:00
{
2019-02-12 01:52:20 -08:00
return getBooleanValue ( subSkillType . getAdvConfigAddress ( ) + " .Classic " ) ;
2018-12-31 10:10:00 -08:00
}
2012-11-21 21:49:54 +01:00
/* ACROBATICS */
2019-02-12 01:52:20 -08:00
public double getDodgeDamageModifier ( ) { return getDoubleValue ( " Skills.Acrobatics.Dodge.DamageModifier " ) ; }
2012-12-24 16:56:25 -05:00
2019-02-12 01:52:20 -08:00
public double getRollDamageThreshold ( ) { return getDoubleValue ( " Skills.Acrobatics.Roll.DamageThreshold " ) ; }
2012-12-24 16:56:25 -05:00
2019-02-12 01:52:20 -08:00
public double getGracefulRollDamageThreshold ( ) { return getDoubleValue ( " Skills.Acrobatics.GracefulRoll.DamageThreshold " ) ; }
2012-11-21 21:49:54 +01:00
2013-11-15 18:21:00 -05:00
/* ALCHEMY */
2019-02-12 01:52:20 -08:00
public int getCatalysisMaxBonusLevel ( ) { return getIntValue ( " Skills.Alchemy.Catalysis.MaxBonusLevel " ) ; }
2014-01-18 11:50:42 +01:00
2019-02-12 01:52:20 -08:00
public double getCatalysisMinSpeed ( ) { return getDoubleValue ( " Skills.Alchemy.Catalysis.MinSpeed " ) ; }
public double getCatalysisMaxSpeed ( ) { return getDoubleValue ( " Skills.Alchemy.Catalysis.MaxSpeed " ) ; }
2013-11-15 18:21:00 -05:00
2012-11-21 21:49:54 +01:00
/* ARCHERY */
2019-02-12 01:52:20 -08:00
public double getSkillShotRankDamageMultiplier ( ) { return getDoubleValue ( " Skills.Archery.SkillShot.RankDamageMultiplier " ) ; }
public double getSkillShotDamageMax ( ) { return getDoubleValue ( " Skills.Archery.SkillShot.MaxDamage " ) ; }
2012-11-21 21:49:54 +01:00
2019-02-12 01:52:20 -08:00
public double getDazeBonusDamage ( ) { return getDoubleValue ( " Skills.Archery.Daze.BonusDamage " ) ; }
2012-11-21 21:49:54 +01:00
2019-02-12 01:52:20 -08:00
public double getForceMultiplier ( ) { return getDoubleValue ( " Skills.Archery.ForceMultiplier " ) ; }
2013-05-15 01:19:14 -04:00
2012-11-21 21:49:54 +01:00
/* AXES */
2019-02-12 01:52:20 -08:00
public double getAxeMasteryRankDamageMultiplier ( ) { return getDoubleValue ( " Skills.Axes.AxeMastery.RankDamageMultiplier " ) ; }
2012-11-21 21:49:54 +01:00
2019-02-12 01:52:20 -08:00
public double getCriticalStrikesPVPModifier ( ) { return getDoubleValue ( " Skills.Axes.CriticalStrikes.PVP_Modifier " ) ; }
public double getCriticalStrikesPVEModifier ( ) { return getDoubleValue ( " Skills.Axes.CriticalStrikes.PVE_Modifier " ) ; }
2012-12-24 16:56:25 -05:00
2019-02-12 01:52:20 -08:00
public double getGreaterImpactChance ( ) { return getDoubleValue ( " Skills.Axes.GreaterImpact.Chance " ) ; }
public double getGreaterImpactModifier ( ) { return getDoubleValue ( " Skills.Axes.GreaterImpact.KnockbackModifier " ) ; }
public double getGreaterImpactBonusDamage ( ) { return getDoubleValue ( " Skills.Axes.GreaterImpact.BonusDamage " ) ; }
2012-12-02 22:54:03 +01:00
2019-01-24 15:23:39 -08:00
public int getArmorImpactIncreaseLevel ( ) {
2019-02-12 01:52:20 -08:00
int increaseLevel = getIntValue ( " Skills.Axes.ArmorImpact.IncreaseLevel " ) ;
2019-01-24 15:23:39 -08:00
if ( mcMMO . isRetroModeEnabled ( ) )
return increaseLevel * 10 ;
return increaseLevel ;
}
2019-02-12 01:52:20 -08:00
public double getImpactChance ( ) { return getDoubleValue ( " Skills.Axes.ArmorImpact.Chance " ) ; }
public double getArmorImpactMaxDurabilityDamage ( ) { return getDoubleValue ( " Skills.Axes.ArmorImpact.MaxPercentageDurabilityDamage " ) ; }
2012-12-24 16:56:25 -05:00
2019-02-12 01:52:20 -08:00
public double getSkullSplitterModifier ( ) { return getDoubleValue ( " Skills.Axes.SkullSplitter.DamageModifier " ) ; }
2013-01-15 17:00:56 -05:00
2012-11-21 21:49:54 +01:00
/* EXCAVATION */
2012-11-25 16:40:42 -08:00
//Nothing to configure, everything is already configurable in config.yml
2012-12-24 16:56:25 -05:00
2012-11-21 21:49:54 +01:00
/* FISHING */
2019-02-12 01:52:20 -08:00
public double getShakeChance ( int rank ) { return getDoubleValue ( " Skills.Fishing.ShakeChance.Rank_ " + rank ) ; }
public int getFishingVanillaXPModifier ( int rank ) { return getIntValue ( " Skills.Fishing.VanillaXPMultiplier.Rank_ " + rank ) ; }
public int getFishermanDietRankChange ( ) { return getIntValue ( " Skills.Fishing.FishermansDiet.RankChange " ) ; }
public double getMasterAnglerBoatModifier ( ) { return getDoubleValue ( " Skills.Fishing.MasterAngler.BoatModifier " ) ; }
public double getMasterAnglerBiomeModifier ( ) { return getDoubleValue ( " Skills.Fishing.MasterAngler.BiomeModifier " ) ; }
2013-10-10 19:12:25 +02:00
2012-11-21 21:49:54 +01:00
/* HERBALISM */
2019-02-12 01:52:20 -08:00
public int getFarmerDietRankChange ( ) { return getIntValue ( " Skills.Herbalism.FarmersDiet.RankChange " ) ; }
2012-12-24 16:56:25 -05:00
2019-02-12 01:52:20 -08:00
public int getGreenThumbStageChange ( ) { return getIntValue ( " Skills.Herbalism.GreenThumb.StageChange " ) ; }
2013-02-25 09:58:25 -05:00
2012-11-21 21:49:54 +01:00
/* MINING */
2019-03-09 17:31:45 -08:00
public boolean getDoubleDropSilkTouchEnabled ( ) { return config . getBoolean ( " Skills.Mining.DoubleDrops.SilkTouch " , true ) ; }
2019-01-17 08:46:10 -08:00
public int getBlastMiningRankLevel ( int rank ) { return config . getInt ( " Skills.Mining.BlastMining.Rank_Levels.Rank_ " + rank ) ; }
public double getBlastDamageDecrease ( int rank ) { return config . getDouble ( " Skills.Mining.BlastMining.BlastDamageDecrease.Rank_ " + rank ) ; }
public double getOreBonus ( int rank ) { return config . getDouble ( " Skills.Mining.BlastMining.OreBonus.Rank_ " + rank ) ; }
public double getDebrisReduction ( int rank ) { return config . getDouble ( " Skills.Mining.BlastMining.DebrisReduction.Rank_ " + rank ) ; }
public int getDropMultiplier ( int rank ) { return config . getInt ( " Skills.Mining.BlastMining.DropMultiplier.Rank_ " + rank ) ; }
public double getBlastRadiusModifier ( int rank ) { return config . getDouble ( " Skills.Mining.BlastMining.BlastRadiusModifier.Rank_ " + rank ) ; }
2013-02-27 15:45:15 -05:00
2012-11-21 21:49:54 +01:00
/* REPAIR */
2019-02-12 01:52:20 -08:00
public double getRepairMasteryMaxBonus ( ) { return getDoubleValue ( " Skills.Repair.RepairMastery.MaxBonusPercentage " ) ; }
public int getRepairMasteryMaxLevel ( ) { return getIntValue ( " Skills.Repair.RepairMastery.MaxBonusLevel " ) ; }
2012-12-24 16:56:25 -05:00
2013-01-11 00:21:18 +01:00
/* Arcane Forging */
2019-02-12 01:52:20 -08:00
public boolean getArcaneForgingEnchantLossEnabled ( ) { return getBooleanValue ( " Skills.Repair.ArcaneForging.May_Lose_Enchants " ) ; }
public double getArcaneForgingKeepEnchantsChance ( int rank ) { return getDoubleValue ( " Skills.Repair.ArcaneForging.Keep_Enchants_Chance.Rank_ " + rank ) ; }
2013-09-30 16:59:54 +02:00
2019-02-12 01:52:20 -08:00
public boolean getArcaneForgingDowngradeEnabled ( ) { return getBooleanValue ( " Skills.Repair.ArcaneForging.Downgrades_Enabled " ) ; }
public double getArcaneForgingDowngradeChance ( int rank ) { return getDoubleValue ( " Skills.Repair.ArcaneForging.Downgrades_Chance.Rank_ " + rank ) ; }
2013-01-11 00:21:18 +01:00
2013-03-06 12:31:48 -05:00
/* SALVAGE */
2019-02-12 01:52:20 -08:00
public boolean getArcaneSalvageEnchantDowngradeEnabled ( ) { return getBooleanValue ( " Skills.Salvage.ArcaneSalvage.EnchantDowngradeEnabled " ) ; }
public boolean getArcaneSalvageEnchantLossEnabled ( ) { return getBooleanValue ( " Skills.Salvage.ArcaneSalvage.EnchantLossEnabled " ) ; }
2013-03-06 12:31:48 -05:00
2019-02-12 01:52:20 -08:00
public double getArcaneSalvageExtractFullEnchantsChance ( int rank ) { return getDoubleValue ( " Skills.Salvage.ArcaneSalvage.ExtractFullEnchant.Rank_ " + rank ) ; }
public double getArcaneSalvageExtractPartialEnchantsChance ( int rank ) { return getDoubleValue ( " Skills.Salvage.ArcaneSalvage.ExtractPartialEnchant.Rank_ " + rank ) ; }
2013-03-06 12:31:48 -05:00
2013-01-23 17:07:26 -05:00
/* SMELTING */
2019-02-12 01:52:20 -08:00
public int getBurnModifierMaxLevel ( ) { return getIntValue ( " Skills.Smelting.FuelEfficiency.MaxBonusLevel " ) ; }
public double getBurnTimeMultiplier ( ) { return getDoubleValue ( " Skills.Smelting.FuelEfficiency.Multiplier " ) ; }
2013-01-23 17:07:26 -05:00
2019-02-12 01:52:20 -08:00
public double getFluxMiningChance ( ) { return getDoubleValue ( " Skills.Smelting.FluxMining.Chance " ) ; }
2013-01-23 17:07:26 -05:00
2019-02-12 01:52:20 -08:00
public int getSmeltingRankLevel ( int rank ) { return getIntValue ( " Skills.Smelting.Rank_Levels.Rank_ " + rank ) ; }
2013-10-01 17:01:11 +02:00
2019-02-12 01:52:20 -08:00
public int getSmeltingVanillaXPBoostMultiplier ( int rank ) { return getIntValue ( " Skills.Smelting.VanillaXPMultiplier.Rank_ " + rank ) ; }
2013-01-23 17:07:26 -05:00
2012-11-21 21:49:54 +01:00
/* SWORDS */
2019-02-12 01:52:20 -08:00
public double getRuptureDamagePlayer ( ) { return getDoubleValue ( " Skills.Swords.Rupture.DamagePlayer " ) ; }
public double getRuptureDamageMobs ( ) { return getDoubleValue ( " Skills.Swords.Rupture.DamageMobs " ) ; }
2014-10-11 12:18:31 +02:00
2019-02-12 01:52:20 -08:00
public int getRuptureMaxTicks ( ) { return getIntValue ( " Skills.Swords.Rupture.MaxTicks " ) ; }
public int getRuptureBaseTicks ( ) { return getIntValue ( " Skills.Swords.Rupture.BaseTicks " ) ; }
2012-11-21 21:49:54 +01:00
2019-02-12 01:52:20 -08:00
public double getCounterModifier ( ) { return getDoubleValue ( " Skills.Swords.CounterAttack.DamageModifier " ) ; }
2012-12-24 16:56:25 -05:00
2019-02-12 01:52:20 -08:00
public double getSerratedStrikesModifier ( ) { return getDoubleValue ( " Skills.Swords.SerratedStrikes.DamageModifier " ) ; }
public int getSerratedStrikesTicks ( ) { return getIntValue ( " Skills.Swords.SerratedStrikes.RuptureTicks " ) ; }
2013-01-13 13:05:53 +01:00
2012-11-21 21:49:54 +01:00
/* TAMING */
2019-02-12 01:52:20 -08:00
public double getGoreModifier ( ) { return getDoubleValue ( " Skills.Taming.Gore.Modifier " ) ; }
public double getFastFoodChance ( ) { return getDoubleValue ( " Skills.Taming.FastFoodService.Chance " ) ; }
public double getPummelChance ( ) { return getDoubleValue ( " Skills.Taming.Pummel.Chance " ) ; }
public double getThickFurModifier ( ) { return getDoubleValue ( " Skills.Taming.ThickFur.Modifier " ) ; }
public double getShockProofModifier ( ) { return getDoubleValue ( " Skills.Taming.ShockProof.Modifier " ) ; }
2012-11-21 21:49:54 +01:00
2019-02-12 01:52:20 -08:00
public double getSharpenedClawsBonus ( ) { return getDoubleValue ( " Skills.Taming.SharpenedClaws.Bonus " ) ; }
2012-12-24 16:56:25 -05:00
2019-02-12 01:52:20 -08:00
public double getMinHorseJumpStrength ( ) { return getDoubleValue ( " Skills.Taming.CallOfTheWild.MinHorseJumpStrength " ) ; }
public double getMaxHorseJumpStrength ( ) { return getDoubleValue ( " Skills.Taming.CallOfTheWild.MaxHorseJumpStrength " ) ; }
2013-11-10 13:54:45 -05:00
2012-11-21 21:49:54 +01:00
/* UNARMED */
2019-02-12 01:52:20 -08:00
public boolean getDisarmProtected ( ) { return getBooleanValue ( " Skills.Unarmed.Disarm.AntiTheft " ) ; }
2013-01-13 13:05:53 +01:00
2012-11-21 21:49:54 +01:00
/* WOODCUTTING */
}