mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 08:14:00 +02:00
fix max damage not being checked
This commit is contained in:
parent
c703dc68f9
commit
68f63a8ec7
2 changed files with 30 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue