aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/ambientaddons/features
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/com/ambientaddons/features')
-rw-r--r--src/main/kotlin/com/ambientaddons/features/display/ThornOverlay.kt6
-rw-r--r--src/main/kotlin/com/ambientaddons/features/dungeon/DungeonHighlights.kt10
2 files changed, 9 insertions, 7 deletions
diff --git a/src/main/kotlin/com/ambientaddons/features/display/ThornOverlay.kt b/src/main/kotlin/com/ambientaddons/features/display/ThornOverlay.kt
index 70a5d2e..f7e9070 100644
--- a/src/main/kotlin/com/ambientaddons/features/display/ThornOverlay.kt
+++ b/src/main/kotlin/com/ambientaddons/features/display/ThornOverlay.kt
@@ -21,10 +21,13 @@ object ThornOverlay {
private var lastPickedUpBow: Long = -1
private const val bowPickedUpString = "You picked up the Spirit Bow! Use it to attack Thorn!"
+ private val timeUntilBreak: Double
+ get() = 20.0 - ((System.currentTimeMillis() - lastPickedUpBow) / 1000.0)
+
@SubscribeEvent
fun onChat(event: ClientChatReceivedEvent) {
if (SBLocation.dungeonFloor?.floor != 4) return
- if (event.message.unformattedText.stripControlCodes() == bowPickedUpString && lastPickedUpBow < 0) {
+ if (event.message.unformattedText.stripControlCodes() == bowPickedUpString && timeUntilBreak < 0) {
lastPickedUpBow = System.currentTimeMillis()
}
}
@@ -44,7 +47,6 @@ object ThornOverlay {
fun onRenderOverlay(event: RenderGameOverlayEvent) {
if (event.type != RenderGameOverlayEvent.ElementType.TEXT) return
val textStyle = TextStyle.fromInt(config.spiritBowTimer - 1) ?: TextStyle.Outline
- val timeUntilBreak = 20.0 - ((System.currentTimeMillis() - lastPickedUpBow) / 1000.0)
if (config.spiritBowTimer != 0 && SBLocation.dungeonFloor?.floor == 4) {
if (timeUntilBreak > 0) {
val timeString = "${colorizeTime(timeUntilBreak)}%.2f".format(timeUntilBreak)
diff --git a/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonHighlights.kt b/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonHighlights.kt
index 5019151..aedd2e7 100644
--- a/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonHighlights.kt
+++ b/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonHighlights.kt
@@ -4,6 +4,7 @@ import AmbientAddons.Companion.config
import AmbientAddons.Companion.mc
import com.ambientaddons.utils.Area
import com.ambientaddons.utils.Extensions.skyblockID
+import com.ambientaddons.utils.Extensions.stripControlCodes
import com.ambientaddons.utils.SBLocation
import com.ambientaddons.utils.render.EntityUtils
import net.minecraft.entity.Entity
@@ -15,6 +16,7 @@ import net.minecraft.entity.monster.EntitySkeleton
import net.minecraft.entity.passive.EntityBat
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.item.ItemArmor
+import net.minecraftforge.client.event.ClientChatReceivedEvent
import net.minecraftforge.client.event.RenderWorldLastEvent
import net.minecraftforge.event.world.WorldEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -37,7 +39,7 @@ object DungeonHighlights {
@SubscribeEvent
fun onRenderWorld(event: RenderWorldLastEvent) {
- if (SBLocation.area != Area.Dungeon) return
+ if (SBLocation.area != Area.Dungeon || SBLocation.dungeonFloor?.enteredBoss == true) return
mc.theWorld.loadedEntityList.forEach { entity ->
if (entity is EntityArmorStand && entity.customNameTag.contains("✯") && !markedArmorStands.contains(entity)) {
if (config.starredHighlight == 0) return@forEach
@@ -48,10 +50,8 @@ object DungeonHighlights {
}.forEach {
starredMobs.add(it)
}
- } else if (entity is EntityPlayer) {
- if (entity.uniqueID == idkmansry) {
- nearIdkmansry = true
- }
+ } else if (entity is EntityPlayer && mc.thePlayer.uniqueID != idkmansry && entity.uniqueID == idkmansry) {
+ nearIdkmansry = true
}
}
mc.theWorld.loadedEntityList.forEach {