From 3736fb833f7609b833d960d50f037208b2dcee6e Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 23 Sep 2022 17:31:10 +0200 Subject: blaze slayer features --- .../java/at/hannibal2/skyhanni/utils/EntityUtils.kt | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/utils') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt index e9621b319..47575c3f5 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt @@ -73,21 +73,23 @@ object EntityUtils { } } - fun EntityLivingBase.hasMaxHealth(health: Int): Boolean { - return when (this.baseMaxHealth) { - health.toDouble() -> true + fun EntityLivingBase.hasBossHealth(health: Int): Boolean = this.hasMaxHealth(health, true) - //Derpy - health.toDouble() * 2 -> true + fun EntityLivingBase.hasMaxHealth(health: Int, boss: Boolean = false): Boolean { + if (this.baseMaxHealth == health.toDouble()) return true + //Derpy + if (this.baseMaxHealth == health.toDouble() * 2) return true + + if (!boss) { //Corrupted - health.toDouble() * 3 -> true + if (this.baseMaxHealth == health.toDouble() * 3) return true //Derpy + Corrupted - health.toDouble() * 2 * 3 -> true - - else -> false + if (this.baseMaxHealth == health.toDouble() * 2 * 3) return true } + + return false } fun EntityPlayer.getSkinTexture(): String? { -- cgit