From ab5987a3929378e5118f409ea7df014fd70cbdf2 Mon Sep 17 00:00:00 2001 From: Lorenz Date: Wed, 17 Aug 2022 18:29:23 +0200 Subject: add dummy as debug damage indicator and adding debugs --- .../features/damageindicator/BossFinder.kt | 5 +++- .../skyhanni/features/damageindicator/BossType.kt | 2 ++ .../damageindicator/DamageIndicatorManager.kt | 28 ++++++++++++++-------- .../features/damageindicator/EntityData.kt | 2 +- 4 files changed, 25 insertions(+), 12 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossFinder.kt index 9a91c7680..5b64e9150 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossFinder.kt @@ -241,7 +241,7 @@ class BossFinder { } if (entity is EntityIronGolem) { if (entity.hasNameTagWith(3, "§e﴾ §8[§7Lv100§8] §lEndstone Protector§r ")) { - return EntityResult(bossType = BossType.END_ENDSTONE_PROTECTOR, ignoreBlocks = true) + return EntityResult(bossType = BossType.END_ENDSTONE_PROTECTOR) } } if (entity is EntityZombie) { @@ -266,6 +266,9 @@ class BossFinder { return EntityResult(bossType = BossType.SLAYER_ZOMBIE_5) } } + if (entity.hasNameTagWith(2, "Dummy §a10M§c❤")) { + return EntityResult(bossType = BossType.DUMMY) + } } if (entity is EntityMagmaCube) { if (entity.hasNameTagWith(15, "§e﴾ §8[§7Lv500§8] §l§4§lMagma Boss§r ")) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossType.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossType.kt index 0bae4bbbd..109bfa9bc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossType.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossType.kt @@ -48,6 +48,8 @@ enum class BossType(val fullName: String, val bossTypeToggle: Int, val shortName DUNGEON_F("", 16), DUNGEON_75("", 17), + DUMMY("Dummy", 18), + //TODO arachne //TODO corelone diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt index 1feaaa7ab..a95b1eda9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt @@ -59,13 +59,17 @@ class DamageIndicatorManager { val player = Minecraft.getMinecraft().thePlayer //TODO config to define between 100ms and 5 sec - for (uuid in data.filter { System.currentTimeMillis() > it.value.timeLastTick + if (it.value.dead) 3_000 else 100 } + for (uuid in data.filter { System.currentTimeMillis() > it.value.timeLastTick + if (it.value.dead) 4_000 else 100 } .map { it.key }) { data.remove(uuid) } for (data in data.values) { - tickDamage(data.damageCounter) + + //TODO test end stone protector in hole? - maybe change eye pos +// data.ignoreBlocks = +// data.bossType == BossType.END_ENDSTONE_PROTECTOR && Minecraft.getMinecraft().thePlayer.isSneaking + if (!data.ignoreBlocks) { if (!player.canEntityBeSeen(data.entity)) continue } @@ -96,9 +100,9 @@ class DamageIndicatorManager { loc } - if (!data.healthLineHidden) { - RenderUtils.drawLabel(location, healthText, partialTicks, true, 6f) - } +// if (!data.healthLineHidden) { + RenderUtils.drawLabel(location, healthText, partialTicks, true, 6f) +// } var bossName = when (SkyHanniMod.feature.damageIndicator.bossName) { 0 -> "" @@ -113,7 +117,9 @@ class DamageIndicatorManager { if (data.nameSuffix.isNotEmpty()) { bossName += data.nameSuffix } - + //TODO fix scaling problem +// val debug = Minecraft.getMinecraft().thePlayer.isSneaking +// RenderUtils.drawLabel(location, bossName, partialTicks, true, 3.9f, -9.0f, debug = debug) RenderUtils.drawLabel(location, bossName, partialTicks, true, 3.9f, -9.0f) if (SkyHanniMod.feature.damageIndicator.showDamageOverTime) { @@ -222,6 +228,7 @@ class DamageIndicatorManager { val lastHealth = data[entity.uniqueID]!!.lastHealth val bossType = entityData.bossType checkDamage(entityData, health, lastHealth, bossType) + tickDamage(entityData.damageCounter) } entityData.lastHealth = health @@ -312,8 +319,9 @@ class DamageIndicatorManager { } + " §f" //hide while in the middle - val position = entity.getLorenzVec() - entityData.healthLineHidden = position.x == -368.0 && position.z == -804.0 +// val position = entity.getLorenzVec() + //TODO other logic or something +// entityData.healthLineHidden = position.x == -368.0 && position.z == -804.0 var calcHealth = -1 for (line in ScoreboardData.sidebarLinesRaw) { @@ -446,7 +454,7 @@ class DamageIndicatorManager { } } else if (DungeonData.isOneOf("M4")) { maxHealth = 6 - when (realHealth) { + when (realHealth) { //TODO test all non derpy values! 1_800_000 / 2, 1_800_000 -> 6 1_494_000 / 2, 1_494_000 -> 5 @@ -531,7 +539,7 @@ class DamageIndicatorManager { } @SubscribeEvent - fun onWorldRender(event: EntityJoinWorldEvent) { + fun onEntityJoin(event: EntityJoinWorldEvent) { bossFinder?.handleNewEntity(event.entity) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/EntityData.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/EntityData.kt index a28c6822a..f2483aae9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/EntityData.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/EntityData.kt @@ -14,7 +14,7 @@ class EntityData( var lastHealth: Int = 0, var healthText: String = "", var timeLastTick: Long = 0, - var healthLineHidden: Boolean = false, +// var healthLineHidden: Boolean = false, var namePrefix: String = "", var nameSuffix: String = "", var dead: Boolean = false, -- cgit