From b63280a2aa64160941d4c8cb8f4b3c6dd5e8862d Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 8 Apr 2019 05:04:12 -0700 Subject: [PATCH] SkillProperty pt 1 --- .../ConfigSectionExploitAcrobatics.java | 8 +++--- .../repairmastery/RepairMasterySettings.java | 2 -- .../properties/AbstractScalingProperty.java | 24 ++++++++++++++++++ .../skills/properties/MaxBonusLevel.java | 25 +++++++++++++++++++ .../skills/properties/ScalingProperty.java | 9 +++++++ .../skills/properties/SkillProperty.java | 10 ++++++++ .../gmail/nossr50/skills/repair/Repair.java | 1 + 7 files changed, 73 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/gmail/nossr50/datatypes/skills/properties/AbstractScalingProperty.java create mode 100644 src/main/java/com/gmail/nossr50/datatypes/skills/properties/MaxBonusLevel.java create mode 100644 src/main/java/com/gmail/nossr50/datatypes/skills/properties/ScalingProperty.java create mode 100644 src/main/java/com/gmail/nossr50/datatypes/skills/properties/SkillProperty.java diff --git a/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigSectionExploitAcrobatics.java b/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigSectionExploitAcrobatics.java index 626968597..42f078da6 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigSectionExploitAcrobatics.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigSectionExploitAcrobatics.java @@ -6,10 +6,10 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; @ConfigSerializable public class ConfigSectionExploitAcrobatics { - public static final int ACROBATIC_LOCATION_LIMIT_DEFAULT = 50; - public static final boolean PREVENT_ACROBATICS_ABUSE_DEFAULT = true; - public static final int TELEPORT_COOLDOWN_DEFAULT = 30; - public static final int ROLL_XP_GAIN_CD_DEFAULT = 60; + private static final int ACROBATIC_LOCATION_LIMIT_DEFAULT = 50; + private static final boolean PREVENT_ACROBATICS_ABUSE_DEFAULT = true; + private static final int TELEPORT_COOLDOWN_DEFAULT = 30; + private static final int ROLL_XP_GAIN_CD_DEFAULT = 60; @Setting(value = "Player-Fall-Location-Tracking", comment = "The amount of locations to keep track of for player falls." + diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/repair/repairmastery/RepairMasterySettings.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/repair/repairmastery/RepairMasterySettings.java index 6d68af6f7..d36bd824e 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/repair/repairmastery/RepairMasterySettings.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/repair/repairmastery/RepairMasterySettings.java @@ -1,7 +1,5 @@ package com.gmail.nossr50.config.hocon.skills.repair.repairmastery; -import com.gmail.nossr50.annotation.SkillProperty; -import com.gmail.nossr50.datatypes.skills.SubSkillType; import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/properties/AbstractScalingProperty.java b/src/main/java/com/gmail/nossr50/datatypes/skills/properties/AbstractScalingProperty.java new file mode 100644 index 000000000..9c8c2a83e --- /dev/null +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/properties/AbstractScalingProperty.java @@ -0,0 +1,24 @@ +package com.gmail.nossr50.datatypes.skills.properties; + +import com.gmail.nossr50.datatypes.skills.SubSkillType; + +public abstract class AbstractScalingProperty implements ScalingProperty { + public SubSkillType subSkillType; + + public AbstractScalingProperty(SubSkillType subSkillType) { + super(); + this.subSkillType = subSkillType; + } + + @Override + public SubSkillType getSubSkillType() { + return subSkillType; + } + + @Override + public String toString() { + return "AbstractScalingProperty{" + + "subSkillType=" + subSkillType + + '}'; + } +} diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/properties/MaxBonusLevel.java b/src/main/java/com/gmail/nossr50/datatypes/skills/properties/MaxBonusLevel.java new file mode 100644 index 000000000..890e54a5c --- /dev/null +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/properties/MaxBonusLevel.java @@ -0,0 +1,25 @@ +package com.gmail.nossr50.datatypes.skills.properties; + +import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.mcMMO; + +public class MaxBonusLevel extends AbstractScalingProperty { + public MaxBonusLevel(SubSkillType subSkillType) { + super(subSkillType); + } + + /** + * Returns the appropriate value for this scaling property whether it is Standard or Retro + * + * @return the value used in scaling calculations for this ScalingProperty + */ + @Override + public double getValue() { + if(mcMMO.getConfigManager().isRetroMode()) + { + + } else { + + } + } +} diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/properties/ScalingProperty.java b/src/main/java/com/gmail/nossr50/datatypes/skills/properties/ScalingProperty.java new file mode 100644 index 000000000..e5783c1a9 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/properties/ScalingProperty.java @@ -0,0 +1,9 @@ +package com.gmail.nossr50.datatypes.skills.properties; + +public interface ScalingProperty extends SkillProperty { + /** + * Returns the appropriate value for this scaling property whether it is Standard or Retro + * @return the value used in scaling calculations for this ScalingProperty + */ + double getValue(); +} diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/properties/SkillProperty.java b/src/main/java/com/gmail/nossr50/datatypes/skills/properties/SkillProperty.java new file mode 100644 index 000000000..6a3895884 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/properties/SkillProperty.java @@ -0,0 +1,10 @@ +package com.gmail.nossr50.datatypes.skills.properties; + +import com.gmail.nossr50.datatypes.skills.SubSkillType; + +/** + * Skill Properties are various values used for interactions of sub-skills + */ +public interface SkillProperty { + SubSkillType getSubSkillType(); +} diff --git a/src/main/java/com/gmail/nossr50/skills/repair/Repair.java b/src/main/java/com/gmail/nossr50/skills/repair/Repair.java index be020a77d..964444684 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/Repair.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/Repair.java @@ -12,6 +12,7 @@ public class Repair { public Repair() { anvilMaterial = mcMMO.getConfigManager().getConfigRepair().getRepairGeneral().getRepairAnvilMaterial(); + //TODO: Replace this horrid shit if(mcMMO.isRetroModeEnabled()) { repairMasteryMaxBonus = mcMMO.getConfigManager().getConfigRepair().getRepairSubSkills().getRepairMastery().getSettings().getRetro().getMaxBonusPercentage();