9
0
mirror of https://github.com/Auxilor/EcoSkills.git synced 2026-01-06 15:51:52 +00:00

Fixed exploration skill disable

Before even if the skill was disabled the player was gaining XP from falling, now it's fixed.
This commit is contained in:
jdkeke142
2022-09-06 21:43:32 +02:00
committed by GitHub
parent 5cfb75171e
commit 96ebdfb6a6

View File

@@ -46,12 +46,8 @@ class SkillExploration : Skill(
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
fun handleLevelling(event: EntityDamageEvent) {
val player = event.entity
if (player !is Player) {
return
}
val player = (event.entity as? Player)?.filterSkillEnabled() ?: return
if (this.config.getStrings("disabled-in-worlds").containsIgnoreCase(player.getWorld().getName())) {
return
}
@@ -71,4 +67,4 @@ class SkillExploration : Skill(
val xp = this.config.getDouble("fall-damage-xp-per-hp") * event.finalDamage
player.giveSkillExperience(this, xp)
}
}
}