From d4245bb705c7d8965e6bf63c90614dcfef38dcf7 Mon Sep 17 00:00:00 2001 From: Appability Date: Thu, 13 Oct 2022 20:17:26 -0700 Subject: various fixes --- .../com/ambientaddons/features/dungeon/DungeonHighlights.kt | 9 +++++++-- .../ambientaddons/features/dungeon/terminals/MelodyHelper.kt | 10 +++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonHighlights.kt b/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonHighlights.kt index 50cc00a..258d799 100644 --- a/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonHighlights.kt +++ b/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonHighlights.kt @@ -17,6 +17,7 @@ import net.minecraft.entity.passive.EntityBat import net.minecraft.entity.player.EntityPlayer import net.minecraft.item.ItemArmor import net.minecraftforge.client.event.RenderWorldLastEvent +import net.minecraftforge.event.world.WorldEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.* @@ -28,6 +29,11 @@ object DungeonHighlights { private val idkmansry = UUID.fromString("93ce1cad-833f-46ff-a124-b66d2b99c4fd") + @SubscribeEvent + fun onWorldUnload(event: WorldEvent.Unload) { + markedArmorStands.clear() + starredMobs.clear() + } @SubscribeEvent fun onRenderWorld(event: RenderWorldLastEvent) { @@ -78,8 +84,7 @@ object DungeonHighlights { private fun renderShadowHighlight(entity: EntityPlayer, partialTicks: Float) { if (config.saHighlight == 0) return val boots = entity.getCurrentArmor(0) - if (entity.heldItem?.skyblockID != "SILENT DEATH" && (boots?.item as? ItemArmor)?.getColor(boots) != 6029470) return - UChat.chat("SA held item: ${entity.heldItem?.skyblockID}") + if (entity.heldItem?.skyblockID != "SILENT_DEATH" && (boots?.item as? ItemArmor)?.getColor(boots) != 6029470) return EntityUtils.drawEntityBox( entity, config.saColor, outline = true, fill = false, config.saHighlight == 2, partialTicks ) diff --git a/src/main/kotlin/com/ambientaddons/features/dungeon/terminals/MelodyHelper.kt b/src/main/kotlin/com/ambientaddons/features/dungeon/terminals/MelodyHelper.kt index 468a6a9..74b23e7 100644 --- a/src/main/kotlin/com/ambientaddons/features/dungeon/terminals/MelodyHelper.kt +++ b/src/main/kotlin/com/ambientaddons/features/dungeon/terminals/MelodyHelper.kt @@ -9,14 +9,22 @@ import com.ambientaddons.utils.Extensions.stripControlCodes import com.ambientaddons.utils.SkyBlock import net.minecraftforge.client.event.ClientChatReceivedEvent import net.minecraftforge.client.event.GuiOpenEvent +import net.minecraftforge.event.world.WorldEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object MelodyHelper { - private val completedStageRegex = Regex("/^[A-za-z0-9_]{3,16} (?:completed|activated) a (?:lever|terminal|device)! \\((?:[07]\\/7|[08]\\/8)\\)/") + private val completedStageRegex = Regex("/^[A-za-z0-9_]{3,16} (?:completed|activated) a (?:lever|terminal|device)! \\((?:[07]\\/7|[08]\\/8)\\)") private var hasSaidMeowlody = false private var hasSaidThrottled = false private var isThrottled = false + @SubscribeEvent + fun onWorldUnload(event: WorldEvent.Unload) { + hasSaidMeowlody = false + hasSaidThrottled = false + isThrottled = false + } + @SubscribeEvent fun onChat(event: ClientChatReceivedEvent) { if (SkyBlock.dungeonFloor?.floor != 7) return -- cgit