From 1a3832f117acb92af2770bdae941fe1293793949 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 20 Sep 2019 17:00:58 -0700 Subject: [PATCH] Correct structure of Archery skill config to have parity with others --- .../hocon/skills/archery/ConfigArchery.java | 34 +++++--------- .../archery/ConfigArcheryLimitBreak.java | 17 +++++++ .../archery/ConfigArcherySubSkills.java | 44 +++++++++++++++++++ .../util/experience/ExperienceBarWrapper.java | 1 - 4 files changed, 73 insertions(+), 23 deletions(-) create mode 100644 src/main/java/com/gmail/nossr50/config/hocon/skills/archery/ConfigArcheryLimitBreak.java create mode 100644 src/main/java/com/gmail/nossr50/config/hocon/skills/archery/ConfigArcherySubSkills.java diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/archery/ConfigArchery.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/archery/ConfigArchery.java index 922312e49..d20eb8634 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/archery/ConfigArchery.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/archery/ConfigArchery.java @@ -1,46 +1,36 @@ package com.gmail.nossr50.config.hocon.skills.archery; -import com.gmail.nossr50.datatypes.skills.properties.MaxBonusLevel; +import com.gmail.nossr50.config.ConfigConstants; import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; @ConfigSerializable public class ConfigArchery { - @Setting(value = "Daze") - private ConfigArcheryDaze daze = new ConfigArcheryDaze(); - - @Setting(value = "Skill-Shot") - private ConfigArcherySkillShot skillShot = new ConfigArcherySkillShot(); - - @Setting("Arrow-Retrieval") - private ConfigArcheryArrowRetrieval arrowRetrieval = new ConfigArcheryArrowRetrieval(); + @Setting(value = ConfigConstants.SUB_SKILL_NODE) + private ConfigArcherySubSkills subSkills = new ConfigArcherySubSkills(); public ConfigArcheryDaze getDaze() { - return daze; + return subSkills.getDaze(); } public ConfigArcherySkillShot getSkillShot() { - return skillShot; + return subSkills.getSkillShot(); + } + + public ConfigArcheryLimitBreak getLimitBreak() { + return subSkills.getLimitBreak(); } public double getSkillShotDamageMultiplier() { - return skillShot.getSkillShotDamageMultiplier(); + return subSkills.getSkillShotDamageMultiplier(); } public double getSkillShotDamageCeiling() { - return skillShot.getSkillShotDamageCeiling(); - } - - public double getMaxChance() { - return daze.getMaxChance(); - } - - public MaxBonusLevel getMaxBonusLevel() { - return daze.getMaxBonusLevel(); + return subSkills.getSkillShotDamageCeiling(); } public double getBonusDamage() { - return daze.getDazeBonusDamage(); + return subSkills.getBonusDamage(); } } \ No newline at end of file diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/archery/ConfigArcheryLimitBreak.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/archery/ConfigArcheryLimitBreak.java new file mode 100644 index 000000000..737ae81bc --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/archery/ConfigArcheryLimitBreak.java @@ -0,0 +1,17 @@ +package com.gmail.nossr50.config.hocon.skills.archery; + +import ninja.leaping.configurate.objectmapping.Setting; + +public class ConfigArcheryLimitBreak { + + private static final boolean DEFAULT_PVE = false; + + @Setting(value = "PVE", comment = "If true, the bonus damage from Limit Break will apply to PVE in addition to PVP." + + "\nDefault value: "+DEFAULT_PVE) + private boolean PVE = DEFAULT_PVE; + + public boolean isEnabledForPVE() { + return PVE; + } + +} diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/archery/ConfigArcherySubSkills.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/archery/ConfigArcherySubSkills.java new file mode 100644 index 000000000..c43c65709 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/archery/ConfigArcherySubSkills.java @@ -0,0 +1,44 @@ +package com.gmail.nossr50.config.hocon.skills.archery; + +import ninja.leaping.configurate.objectmapping.Setting; +import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; + +@ConfigSerializable +public class ConfigArcherySubSkills { + + @Setting(value = "Daze") + private ConfigArcheryDaze daze = new ConfigArcheryDaze(); + + @Setting(value = "Skill-Shot") + private ConfigArcherySkillShot skillShot = new ConfigArcherySkillShot(); + + @Setting("Arrow-Retrieval") + private ConfigArcheryArrowRetrieval arrowRetrieval = new ConfigArcheryArrowRetrieval(); + + @Setting("Limit-Break") + private ConfigArcheryLimitBreak limitBreak = new ConfigArcheryLimitBreak(); + + public ConfigArcheryDaze getDaze() { + return daze; + } + + public ConfigArcherySkillShot getSkillShot() { + return skillShot; + } + + public ConfigArcheryLimitBreak getLimitBreak() { + return limitBreak; + } + + public double getSkillShotDamageMultiplier() { + return skillShot.getSkillShotDamageMultiplier(); + } + + public double getSkillShotDamageCeiling() { + return skillShot.getSkillShotDamageCeiling(); + } + + public double getBonusDamage() { + return daze.getDazeBonusDamage(); + } +} diff --git a/src/main/java/com/gmail/nossr50/util/experience/ExperienceBarWrapper.java b/src/main/java/com/gmail/nossr50/util/experience/ExperienceBarWrapper.java index d348d4a44..f633c4efe 100644 --- a/src/main/java/com/gmail/nossr50/util/experience/ExperienceBarWrapper.java +++ b/src/main/java/com/gmail/nossr50/util/experience/ExperienceBarWrapper.java @@ -4,7 +4,6 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.StringUtils; -import com.gmail.nossr50.util.player.PlayerLevelTools; import org.bukkit.boss.BarColor; import org.bukkit.boss.BarStyle; import org.bukkit.boss.BossBar;