From 5d6eb185ddae598850aca6c03162eb2b9901a7ea Mon Sep 17 00:00:00 2001 From: Auxilor Date: Fri, 20 Aug 2021 14:36:15 +0100 Subject: [PATCH] Continued backend --- .../com/willfp/ecoskills/EcoSkillsPlugin.java | 6 ++ .../com/willfp/ecoskills/effects/Effects.java | 28 ++++--- .../com/willfp/ecoskills/EcoSkillsPlayer.kt | 9 +++ .../com/willfp/ecoskills/effects/Effect.kt | 3 + .../effects/effects/EffectBountifulHarvest.kt | 8 ++ .../effects/effects/EffectCraftsmanship.kt | 8 ++ .../effects/effects/EffectEyeOfTheDepths.kt | 8 ++ .../effects/effects/EffectPotionmaster.kt | 8 ++ .../effects/effects/EffectSeamlessMovement.kt | 8 ++ .../effects/effects/EffectSecondChance.kt | 8 ++ .../effects/effects/EffectSerratedStrikes.kt | 8 ++ .../effects/effects/EffectShamanism.kt | 8 ++ .../effects/effects/EffectVersatileTools.kt | 8 ++ .../com/willfp/ecoskills/skills/Skill.kt | 9 ++- .../kotlin/com/willfp/ecoskills/stats/Stat.kt | 26 ++++-- .../ecoskills/stats/stats/StatDefense.kt | 27 +++++++ .../ecoskills/stats/stats/StatStrength.kt | 36 +++++++++ .../core-plugin/src/main/resources/config.yml | 80 +++++++++++++++++++ .../core-plugin/src/main/resources/lang.yml | 77 ++++++++++-------- 19 files changed, 322 insertions(+), 51 deletions(-) create mode 100644 eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectBountifulHarvest.kt create mode 100644 eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectCraftsmanship.kt create mode 100644 eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectEyeOfTheDepths.kt create mode 100644 eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectPotionmaster.kt create mode 100644 eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectSeamlessMovement.kt create mode 100644 eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectSecondChance.kt create mode 100644 eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectSerratedStrikes.kt create mode 100644 eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectShamanism.kt create mode 100644 eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectVersatileTools.kt create mode 100644 eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/stats/stats/StatDefense.kt create mode 100644 eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/stats/stats/StatStrength.kt diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/EcoSkillsPlugin.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/EcoSkillsPlugin.java index ac243a8..411d16d 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/EcoSkillsPlugin.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/EcoSkillsPlugin.java @@ -5,6 +5,8 @@ import com.willfp.eco.core.command.impl.PluginCommand; import com.willfp.ecoskills.commands.CommandEcoskills; import com.willfp.ecoskills.effects.Effect; import com.willfp.ecoskills.effects.Effects; +import com.willfp.ecoskills.stats.Stat; +import com.willfp.ecoskills.stats.Stats; import org.bukkit.event.Listener; import java.util.Arrays; @@ -30,6 +32,10 @@ public class EcoSkillsPlugin extends EcoPlugin { this.getEventManager().unregisterListener(effect); this.getEventManager().registerListener(effect); } + for (Stat stat : Stats.values()) { + this.getEventManager().unregisterListener(stat); + this.getEventManager().registerListener(stat); + } } /** diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/effects/Effects.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/effects/Effects.java index ee23546..44135cf 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/effects/Effects.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/effects/Effects.java @@ -3,7 +3,15 @@ package com.willfp.ecoskills.effects; import com.google.common.collect.ImmutableSet; import com.willfp.eco.core.config.updating.ConfigUpdater; import com.willfp.ecoskills.EcoSkillsPlugin; -import com.willfp.ecoskills.skills.Skill; +import com.willfp.ecoskills.effects.effects.EffectBountifulHarvest; +import com.willfp.ecoskills.effects.effects.EffectCraftsmanship; +import com.willfp.ecoskills.effects.effects.EffectEyeOfTheDepths; +import com.willfp.ecoskills.effects.effects.EffectPotionmaster; +import com.willfp.ecoskills.effects.effects.EffectSeamlessMovement; +import com.willfp.ecoskills.effects.effects.EffectSecondChance; +import com.willfp.ecoskills.effects.effects.EffectSerratedStrikes; +import com.willfp.ecoskills.effects.effects.EffectShamanism; +import com.willfp.ecoskills.effects.effects.EffectVersatileTools; import org.bukkit.NamespacedKey; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; @@ -24,15 +32,15 @@ public class Effects { */ private static final EcoSkillsPlugin PLUGIN = EcoSkillsPlugin.getInstance(); - public static final Skill MINING = new Skill(PLUGIN, "mining"); - public static final Skill COMBAT = new Skill(PLUGIN, "combat"); - public static final Skill ENCHANTING = new Skill(PLUGIN, "enchanting"); - public static final Skill FARMING = new Skill(PLUGIN, "farming"); - public static final Skill WOODCUTTING = new Skill(PLUGIN, "woodcutting"); - public static final Skill FISHING = new Skill(PLUGIN, "fishing"); - public static final Skill ALCHEMY = new Skill(PLUGIN, "alchemy"); - public static final Skill ARMORY = new Skill(PLUGIN, "armory"); - public static final Skill EXPLORATION = new Skill(PLUGIN, "exploration"); + public static final Effect BOUNTIFUL_HARVEST = new EffectBountifulHarvest(); + public static final Effect CRAFTSMANSHIP = new EffectCraftsmanship(); + public static final Effect EYE_OF_THE_DEPTHS = new EffectEyeOfTheDepths(); + public static final Effect POTIONMASTER = new EffectPotionmaster(); + public static final Effect SEAMLESS_MOVEMENT = new EffectSeamlessMovement(); + public static final Effect SECOND_CHANCE = new EffectSecondChance(); + public static final Effect SERRATED_STRIKES = new EffectSerratedStrikes(); + public static final Effect SHAMANISM = new EffectShamanism(); + public static final Effect VERSATILE_TOOLS = new EffectVersatileTools(); @ApiStatus.Internal public static void registerNewEffect(@NotNull final Effect effect) { diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/EcoSkillsPlayer.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/EcoSkillsPlayer.kt index 69bf01d..c77437e 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/EcoSkillsPlayer.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/EcoSkillsPlayer.kt @@ -19,4 +19,13 @@ fun Player.getEffectLevel(effect: Effect): Int { fun Player.setEffectLevel(effect: Effect, level: Int) { this.persistentDataContainer.set(effect.key, PersistentDataType.INTEGER, level) +} + +fun Player.getStatLevel(stat: Stat): Int { + return this.persistentDataContainer.getOrDefault(stat.key, PersistentDataType.INTEGER, 1) +} + +fun Player.setStatLevel(stat: Stat, level: Int) { + this.persistentDataContainer.set(stat.key, PersistentDataType.INTEGER, level) + stat.updateStatLevel(this) } \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/Effect.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/Effect.kt index 987ef0b..748c9ea 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/Effect.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/Effect.kt @@ -1,6 +1,7 @@ package com.willfp.ecoskills.effects import com.willfp.eco.core.EcoPlugin +import com.willfp.eco.core.config.interfaces.Config import com.willfp.ecoskills.EcoSkillsPlugin import org.bukkit.NamespacedKey import org.bukkit.event.Listener @@ -13,6 +14,7 @@ abstract class Effect( val key: NamespacedKey val uuid: UUID + val config: Config lateinit var name: String lateinit var description: String @@ -20,6 +22,7 @@ abstract class Effect( update() key = plugin.namespacedKeyFactory.create(id) uuid = UUID.nameUUIDFromBytes(id.toByteArray()) + config = plugin.configYml.getSubsection("effects.$id") Effects.registerNewEffect(this) } diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectBountifulHarvest.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectBountifulHarvest.kt new file mode 100644 index 0000000..0a3979a --- /dev/null +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectBountifulHarvest.kt @@ -0,0 +1,8 @@ +package com.willfp.ecoskills.effects.effects + +import com.willfp.ecoskills.effects.Effect + +class EffectBountifulHarvest: Effect( + "bountiful_harvest" +) { +} \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectCraftsmanship.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectCraftsmanship.kt new file mode 100644 index 0000000..cedef02 --- /dev/null +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectCraftsmanship.kt @@ -0,0 +1,8 @@ +package com.willfp.ecoskills.effects.effects + +import com.willfp.ecoskills.effects.Effect + +class EffectCraftsmanship: Effect( + "craftsmanship" +) { +} \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectEyeOfTheDepths.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectEyeOfTheDepths.kt new file mode 100644 index 0000000..1fec875 --- /dev/null +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectEyeOfTheDepths.kt @@ -0,0 +1,8 @@ +package com.willfp.ecoskills.effects.effects + +import com.willfp.ecoskills.effects.Effect + +class EffectEyeOfTheDepths: Effect( + "eye_of_the_depths" +) { +} \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectPotionmaster.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectPotionmaster.kt new file mode 100644 index 0000000..88a7371 --- /dev/null +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectPotionmaster.kt @@ -0,0 +1,8 @@ +package com.willfp.ecoskills.effects.effects + +import com.willfp.ecoskills.effects.Effect + +class EffectPotionmaster: Effect( + "potionmaster" +) { +} \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectSeamlessMovement.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectSeamlessMovement.kt new file mode 100644 index 0000000..1275361 --- /dev/null +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectSeamlessMovement.kt @@ -0,0 +1,8 @@ +package com.willfp.ecoskills.effects.effects + +import com.willfp.ecoskills.effects.Effect + +class EffectSeamlessMovement: Effect( + "seamless_movement" +) { +} \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectSecondChance.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectSecondChance.kt new file mode 100644 index 0000000..96a0960 --- /dev/null +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectSecondChance.kt @@ -0,0 +1,8 @@ +package com.willfp.ecoskills.effects.effects + +import com.willfp.ecoskills.effects.Effect + +class EffectSecondChance: Effect( + "second_chance" +) { +} \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectSerratedStrikes.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectSerratedStrikes.kt new file mode 100644 index 0000000..61be08c --- /dev/null +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectSerratedStrikes.kt @@ -0,0 +1,8 @@ +package com.willfp.ecoskills.effects.effects + +import com.willfp.ecoskills.effects.Effect + +class EffectSerratedStrikes: Effect( + "serrated_strikes" +) { +} \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectShamanism.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectShamanism.kt new file mode 100644 index 0000000..f2394be --- /dev/null +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectShamanism.kt @@ -0,0 +1,8 @@ +package com.willfp.ecoskills.effects.effects + +import com.willfp.ecoskills.effects.Effect + +class EffectShamanism: Effect( + "shamanism" +) { +} \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectVersatileTools.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectVersatileTools.kt new file mode 100644 index 0000000..bb08883 --- /dev/null +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectVersatileTools.kt @@ -0,0 +1,8 @@ +package com.willfp.ecoskills.effects.effects + +import com.willfp.ecoskills.effects.Effect + +class EffectVersatileTools: Effect( + "versatile_tools" +) { +} \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/Skill.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/Skill.kt index 987486e..35f1ecf 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/Skill.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/Skill.kt @@ -1,23 +1,28 @@ package com.willfp.ecoskills.skills import com.willfp.eco.core.EcoPlugin +import com.willfp.ecoskills.EcoSkillsPlugin import org.bukkit.NamespacedKey +import java.util.* class Skill( - protected val plugin: EcoPlugin, val id: String ) { + protected val plugin: EcoPlugin = EcoSkillsPlugin.getInstance() + val key: NamespacedKey + val uuid: UUID lateinit var name: String init { update() key = plugin.namespacedKeyFactory.create(id) + uuid = UUID.nameUUIDFromBytes(id.toByteArray()) Skills.registerNewSkill(this) } fun update() { - name = plugin.langYml.getString("skills.names.$id") + name = plugin.langYml.getString("skills.$id.name") } } \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/stats/Stat.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/stats/Stat.kt index fa99ed2..ca80474 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/stats/Stat.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/stats/Stat.kt @@ -1,14 +1,22 @@ package com.willfp.ecoskills.stats import com.willfp.eco.core.EcoPlugin +import com.willfp.eco.core.config.interfaces.Config +import com.willfp.ecoskills.EcoSkillsPlugin import com.willfp.ecoskills.skills.Skills import org.bukkit.NamespacedKey +import org.bukkit.entity.Player +import org.bukkit.event.Listener +import java.util.* -class Stat( - protected val plugin: EcoPlugin, +abstract class Stat( val id: String -) { +) : Listener { + protected val plugin: EcoPlugin = EcoSkillsPlugin.getInstance() + val key: NamespacedKey + val uuid: UUID + val config: Config lateinit var icon: String lateinit var color: String lateinit var name: String @@ -16,13 +24,19 @@ class Stat( init { update() key = plugin.namespacedKeyFactory.create(id) + uuid = UUID.nameUUIDFromBytes(id.toByteArray()) + config = plugin.configYml.getSubsection("stats.$id") Stats.registerNewStat(this) } fun update() { - icon = plugin.langYml.getString("stats.icons.$id") - name = plugin.langYml.getString("stats.names.$id") - color = plugin.langYml.getString("stats.colors.$id") + icon = plugin.langYml.getString("stats.$id.icon") + name = plugin.langYml.getString("stats.$id.name") + color = plugin.langYml.getString("stats.$id.color") + } + + open fun updateStatLevel(player: Player) { + // Override when needed. } } \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/stats/stats/StatDefense.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/stats/stats/StatDefense.kt new file mode 100644 index 0000000..e186268 --- /dev/null +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/stats/stats/StatDefense.kt @@ -0,0 +1,27 @@ +package com.willfp.ecoskills.stats.stats + +import com.willfp.ecoskills.getStatLevel +import com.willfp.ecoskills.stats.Stat +import org.bukkit.entity.Player +import org.bukkit.event.EventHandler +import org.bukkit.event.EventPriority +import org.bukkit.event.entity.EntityDamageEvent + +class StatDefense() : Stat( + "defense" +) { + @EventHandler(priority = EventPriority.LOW) + fun handle(event: EntityDamageEvent) { + if (event.entity !is Player) { + return + } + + val player = event.entity as Player + + var multiplier = this.config.getDouble("percent-less-damage-per-level") * player.getStatLevel(this) + multiplier /= 100 + multiplier += 1 + + event.damage = (event.damage) / multiplier + } +} \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/stats/stats/StatStrength.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/stats/stats/StatStrength.kt new file mode 100644 index 0000000..9847efe --- /dev/null +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/stats/stats/StatStrength.kt @@ -0,0 +1,36 @@ +package com.willfp.ecoskills.stats.stats + +import com.willfp.ecoskills.getStatLevel +import com.willfp.ecoskills.stats.Stat +import org.bukkit.entity.Player +import org.bukkit.entity.Projectile +import org.bukkit.event.EventHandler +import org.bukkit.event.EventPriority +import org.bukkit.event.entity.EntityDamageByEntityEvent + +class StatStrength() : Stat( + "defense" +) { + @EventHandler(priority = EventPriority.LOW) + fun handle(event: EntityDamageByEntityEvent) { + var player = event.damager + + if (player is Projectile) { + if (player.shooter !is Player) { + return + } else { + player = player.shooter as Player + } + } + + if (player !is Player) { + return + } + + var multiplier = this.config.getDouble("percent-more-damage-per-level") * player.getStatLevel(this) + multiplier /= 100 + multiplier += 1 + + event.damage = (event.damage) * multiplier + } +} \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/resources/config.yml b/eco-core/core-plugin/src/main/resources/config.yml index cf178d1..6f80a1c 100644 --- a/eco-core/core-plugin/src/main/resources/config.yml +++ b/eco-core/core-plugin/src/main/resources/config.yml @@ -3,3 +3,83 @@ # by Auxilor # +stats: + defense: + # 100% halves the incoming damage + percent-less-damage-per-level: 1 + strength: + # 100% is double damage + percent-more-damage-per-level: 1 + crit_chance: + # Nothing happens above 100%, 200% is the same as it. + chance-per-level: 1 + crit_damage: + # The percent more damage to deal on crits for each level. + percent-more-damage-per-level: 2 + # The amount more damage to deal on crits by default. + base-percent-more: 50 + speed: + # The percent more speed to give for the speed attribute (internal in the game) + # for each level + percent-faster-per-level: 1 + wisdom: + # The percent more xp to gain from orbs for each level of the stat. + percent-more-xp-gain: 1 + +effects: + bountiful_harvest: + # Chance is as a percentage; if the chance for a player is over 100 then it will always be double drops + # with a chance to get triple drops. Same goes if above 200, but then it will always be triple with a chance + # for quadruple. + chance-per-level: 1 + versatile_tools: + # The percent (%) more damage to deal with a pickaxe for each level of the effect. + percent-more-per-level: 2 + eye_of_the_depths: + # Chance is as a percentage. + chance-per-level: 0.1 + # The rare loot items are listed below. + # You can import drops from the following plugins: + # EcoArmor, EcoItems, Talismans, StatTrackers, EcoWeapons, Reforges, Oraxen + # You can also use vanilla items with their material + # You can set enchantments on items with the following syntax: + # etc + # For example, a reaper scythe with Razor 4 and Criticals 3 would be: + # ecoweapons:reaper_scythe razor:4 criticals:3 + rare-loot-items: + - enchanted_book confusion:1 + - enchanted_book confusion:2 + - netherite_ingot + - ecoarmor:set_miner_helmet + - ecoarmor:set_miner_chestplate + - ecoarmor:set_miner_leggings + - ecoarmor:set_miner_boots + - reforges:dynamic + serrated_strikes: + # Chance is as a percentage. + chance-per-level: 2 + # The damage to deal for each 'bleed tick' + bleed-tick-damage: 2 + # The amount of ticks to wait between each bleed tick + bleed-tick-spacing: 15 + # The amount of bleed ticks to give + bleed-ticks: 4 + seamless_movement: + # The chance to ignore fall damage, as a percentage + chance-per-level: 2 + potionmaster: + # The percent more time for potions to last for each level of the effect + percent-more-per-level: 4 + shamanism: + # The percent faster regen for each level of the effect + percent-faster-per-level: 4 + craftsmanship: + # 100% is double durability + percent-less-per-level: 3 + second_chance: + # Items will try to heal every time durability damage is taken below this level + below-durability-check: 30 + # Chance per level as a percentage + # This will follow a binomial distribution where the amount of trials is the durability check (30 by default, see above) + # Since this chance will be called many times, it would be best to have this be low. + chance-per-level: 0.1 \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/resources/lang.yml b/eco-core/core-plugin/src/main/resources/lang.yml index f37cc7a..52defa7 100644 --- a/eco-core/core-plugin/src/main/resources/lang.yml +++ b/eco-core/core-plugin/src/main/resources/lang.yml @@ -7,39 +7,50 @@ messages: skills: color: "&9" - names: - mining: "Mining" - combat: "Combat" - enchanting: "Enchanting" - farming: "Farming" - woodcutting: "Woodcutting" - fishing: "Fishing" - alchemy: "Alchemy" - armory: "Armory" - exploration: "Exploration" + mining: + name: "Mining" + combat: + name: "Combat" + enchanting: + name: "Enchanting" + farming: + name: "Farming" + woodcutting: + name: "Woodcutting" + fishing: + name: "Fishing" + alchemy: + name: "Alchemy" + armory: + name: "Armory" + exploration: + name: "Exploration" stats: - names: - defense: "Defense" - strength: "Strength" - crit_chance: "Crit Chance" - crit_damage: "Crit Damage" - speed: "Speed" - wisdom: "Wisdom" - colors: - defense: '&#e884b0' - strength: '&#db0000' - crit_chance: '&#f7ff85' - crit_damage: '�d9e' - speed: '(ffe6' - wisdom: '&#c8ffa6' - icons: - defense: '&#e884b0❤' - strength: '&#db0000❁' - crit_chance: '&#f7ff85☣' - crit_damage: '�d9e☠' - speed: '(ffe6✦' - wisdom: '&#c8ffa6✎' + defense: + name: "Defense" + color: '&#e884b0' + icon: '&#e884b0❤' + strength: + name: "Strength" + color: '&#db0000' + icon: '&#db0000❁' + crit_chance: + name: "Crit Chance" + color: '&#f7ff85' + icon: '&#f7ff85☣' + crit_damage: + name: "Crit Damage" + color: '�d9e' + icon: '�d9e☠' + speed: + name: "Speed" + color: '(ffe6' + icon: '(ffe6✦' + wisdom: + name: "Wisdom" + color: '&#c8ffa6' + icon: '&#c8ffa6✎' effects: bountiful_harvest: @@ -63,8 +74,8 @@ effects: shamanism: name: "Shamanism" description: "Increases the speed at which you regain health" - craftmanship: - name: "Craftmanship" + craftsmanship: + name: "Craftsmanship" description: "Take less durability damage on axes" second_chance: name: "Second Chance"