diff --git a/bukkit/src/main/kotlin/com/aiyostudio/esync/internal/module/entity/PlayerStatusEntity.kt b/bukkit/src/main/kotlin/com/aiyostudio/esync/internal/module/entity/PlayerStatusEntity.kt index 81f39ac..d95e969 100644 --- a/bukkit/src/main/kotlin/com/aiyostudio/esync/internal/module/entity/PlayerStatusEntity.kt +++ b/bukkit/src/main/kotlin/com/aiyostudio/esync/internal/module/entity/PlayerStatusEntity.kt @@ -16,7 +16,7 @@ class PlayerStatusEntity : IEntity { try { if (player is Player) { player.getAttribute(Attribute.GENERIC_MAX_HEALTH).baseValue = maxHealth - player.health = health + player.health = Math.min(health, maxHealth) potions.forEach { player.addPotionEffect(it) } return true } diff --git a/bukkit/src/main/kotlin/com/aiyostudio/esync/internal/module/impl/PlayerStatusModuleImpl.kt b/bukkit/src/main/kotlin/com/aiyostudio/esync/internal/module/impl/PlayerStatusModuleImpl.kt index ed147ab..a71e6cf 100644 --- a/bukkit/src/main/kotlin/com/aiyostudio/esync/internal/module/impl/PlayerStatusModuleImpl.kt +++ b/bukkit/src/main/kotlin/com/aiyostudio/esync/internal/module/impl/PlayerStatusModuleImpl.kt @@ -7,7 +7,6 @@ import org.bukkit.Bukkit import org.bukkit.attribute.Attribute import org.bukkit.configuration.ConfigurationSection import org.bukkit.configuration.file.YamlConfiguration -import org.bukkit.configuration.serialization.ConfigurationSerialization import org.bukkit.potion.PotionEffect import java.util.*