9
0
mirror of https://github.com/Auxilor/EcoSkills.git synced 2025-12-31 21:06:40 +00:00

Health scale will forcibly disable now

This commit is contained in:
Auxilor
2023-05-26 13:14:38 +01:00
parent 12f6a0cbc8
commit fbf87cf091
2 changed files with 14 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ import com.willfp.eco.core.packet.PacketListener
import com.willfp.ecoskills.actionbar.ActionBarCompatibilityProxy
import com.willfp.ecoskills.actionbar.ActionBarGamemodeListener
import com.willfp.ecoskills.actionbar.ActionBarHandler
import com.willfp.ecoskills.actionbar.HealthScaleDisabler
import com.willfp.ecoskills.commands.CommandEcoSkills
import com.willfp.ecoskills.commands.CommandSkills
import com.willfp.ecoskills.effects.Effects
@@ -117,6 +118,7 @@ class EcoSkillsPlugin : LibreforgePlugin() {
GainXPDisplay(this),
DamageIndicatorListener(this),
MagicListener(this),
HealthScaleDisabler(this),
ActionBarGamemodeListener,
SkillCritListener,
StatModifierListener

View File

@@ -17,6 +17,7 @@ import org.bukkit.entity.Player
import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.event.player.PlayerGameModeChangeEvent
import org.bukkit.event.player.PlayerJoinEvent
import java.util.UUID
private const val ACTION_BAR_DURATION = 2700L
@@ -148,3 +149,14 @@ class ActionBarHandler(
}
}
}
class HealthScaleDisabler(
private val plugin: EcoPlugin
) : Listener {
@EventHandler
fun handle(event: PlayerJoinEvent) {
if (!plugin.configYml.getBool("persistent-action-bar.scale-health")) {
event.player.isHealthScaled = false
}
}
}