diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-09-23 17:31:10 +0200 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-09-23 17:31:10 +0200 |
| commit | 3736fb833f7609b833d960d50f037208b2dcee6e (patch) | |
| tree | 5a0febc0b8b03bbed28a170d5381e055571e7840 /src/main/java/at/hannibal2/skyhanni/utils | |
| parent | e49183a248f1a007b924d76909274081f2d0fce2 (diff) | |
| download | skyhanni-3736fb833f7609b833d960d50f037208b2dcee6e.tar.gz skyhanni-3736fb833f7609b833d960d50f037208b2dcee6e.tar.bz2 skyhanni-3736fb833f7609b833d960d50f037208b2dcee6e.zip | |
blaze slayer features
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt | 20 |
1 files changed, 11 insertions, 9 deletions
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? { |
