fix max damage not being checked

This commit is contained in:
alexcrea 2026-05-21 22:32:04 +02:00
parent c703dc68f9
commit 68f63a8ec7
Signed by: alexcrea
GPG key ID: E346CD16413450E3
2 changed files with 30 additions and 1 deletions

View file

@ -0,0 +1,18 @@
package xyz.alexcrea.cuanvil.util
import org.bukkit.inventory.meta.Damageable
// I LOVE support of old versions and needing to do modules like that
// That truly is my favorite activity
// TODO clean this one of legacy removal branch
object MaxDamageCheckerUtil {
/**
* @return max damage or int max if not set
*/
fun getMaxDamage(meta: Damageable): Int {
if(!meta.hasMaxDamage()) return Integer.MAX_VALUE
return meta.maxDamage
}
}