diff options
Diffstat (limited to 'src/main/kotlin/com/ambientaddons/features/dungeon')
7 files changed, 21 insertions, 25 deletions
diff --git a/src/main/kotlin/com/ambientaddons/features/dungeon/AutoBuyChest.kt b/src/main/kotlin/com/ambientaddons/features/dungeon/AutoBuyChest.kt index 279402d..f1cd74f 100644 --- a/src/main/kotlin/com/ambientaddons/features/dungeon/AutoBuyChest.kt +++ b/src/main/kotlin/com/ambientaddons/features/dungeon/AutoBuyChest.kt @@ -12,7 +12,7 @@ import com.ambientaddons.utils.Extensions.skyblockID import com.ambientaddons.utils.Extensions.stripControlCodes import com.ambientaddons.utils.Extensions.withModPrefix import com.ambientaddons.utils.Area -import com.ambientaddons.utils.SkyBlock +import com.ambientaddons.utils.SBLocation import gg.essential.universal.UChat import net.minecraft.inventory.ContainerChest import net.minecraft.item.ItemStack @@ -35,7 +35,7 @@ object AutoBuyChest { @SubscribeEvent fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) { - if (SkyBlock.area != Area.Dungeon || rewardChest == null) return + if (SBLocation.area != Area.Dungeon || rewardChest == null) return if (event.slotId == BUY_SLOT_INDEX) { hasOpenedChest = true if (rewardChest == RewardChest.Wood) { @@ -43,7 +43,7 @@ object AutoBuyChest { event.isCanceled = true } } else if (event.slotId == KISMET_SLOT_INDEX) { - if (config.blockLowReroll && rewardChest != RewardChest.Bedrock && (rewardChest != RewardChest.Obsidian || SkyBlock.dungeonFloor.toString() != "M4")) { + if (config.blockLowReroll && rewardChest != RewardChest.Bedrock && (rewardChest != RewardChest.Obsidian || SBLocation.dungeonFloor.toString() != "M4")) { UChat.chat("§cBlocked reroll! This low-tier chest should not be rerolled.".withModPrefix()) event.isCanceled = true return @@ -58,11 +58,9 @@ object AutoBuyChest { } } - - @SubscribeEvent fun onGuiOpen(event: GuiOpenEvent) { - if (SkyBlock.area != Area.Dungeon) return + if (SBLocation.area != Area.Dungeon) return if (event.gui == null) return val chest = event.gui.chest val chestName = chest?.lowerChestInventory?.name @@ -82,7 +80,7 @@ object AutoBuyChest { @SubscribeEvent fun onGuiDraw(event: GuiScreenEvent.DrawScreenEvent) { - if (SkyBlock.area != Area.Dungeon || config.autoBuyChest != 2 || rewardChest == null || hasLookedAtChest) return + if (SBLocation.area != Area.Dungeon || config.autoBuyChest != 2 || rewardChest == null || hasLookedAtChest) return val chest = event.gui?.chest ?: return if (rewardChest == RewardChest.Wood) { if (!hasOpenedChest) openChest(chest) diff --git a/src/main/kotlin/com/ambientaddons/features/dungeon/CloseChest.kt b/src/main/kotlin/com/ambientaddons/features/dungeon/CloseChest.kt index 571cd7f..0e996e1 100644 --- a/src/main/kotlin/com/ambientaddons/features/dungeon/CloseChest.kt +++ b/src/main/kotlin/com/ambientaddons/features/dungeon/CloseChest.kt @@ -4,7 +4,7 @@ import AmbientAddons.Companion.config import AmbientAddons.Companion.mc import com.ambientaddons.events.ReceivePacketEvent import com.ambientaddons.utils.Area -import com.ambientaddons.utils.SkyBlock +import com.ambientaddons.utils.SBLocation import net.minecraft.network.play.client.C0DPacketCloseWindow import net.minecraft.network.play.server.S2DPacketOpenWindow import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -12,7 +12,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object CloseChest { @SubscribeEvent fun onOpenWindow(event: ReceivePacketEvent) { - if (!config.closeSecretChests || SkyBlock.area != Area.Dungeon) return + if (!config.closeSecretChests || SBLocation.area != Area.Dungeon) return if (event.packet !is S2DPacketOpenWindow) return if (event.packet.windowTitle.unformattedText == "Chest") { mc.netHandler.networkManager.sendPacket(C0DPacketCloseWindow(event.packet.windowId)) diff --git a/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonHighlights.kt b/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonHighlights.kt index 258d799..5019151 100644 --- a/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonHighlights.kt +++ b/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonHighlights.kt @@ -4,9 +4,8 @@ import AmbientAddons.Companion.config import AmbientAddons.Companion.mc import com.ambientaddons.utils.Area import com.ambientaddons.utils.Extensions.skyblockID -import com.ambientaddons.utils.SkyBlock +import com.ambientaddons.utils.SBLocation import com.ambientaddons.utils.render.EntityUtils -import gg.essential.universal.UChat import net.minecraft.entity.Entity import net.minecraft.entity.boss.EntityWither import net.minecraft.entity.item.EntityArmorStand @@ -25,20 +24,20 @@ import java.util.* object DungeonHighlights { private val markedArmorStands = mutableSetOf<EntityArmorStand>() private val starredMobs = mutableSetOf<Entity>() - private var nearIdkmansry = false + private var nearIdkmansry = false private val idkmansry = UUID.fromString("93ce1cad-833f-46ff-a124-b66d2b99c4fd") @SubscribeEvent fun onWorldUnload(event: WorldEvent.Unload) { markedArmorStands.clear() starredMobs.clear() + nearIdkmansry = false } @SubscribeEvent fun onRenderWorld(event: RenderWorldLastEvent) { - if (SkyBlock.area != Area.Dungeon) return - nearIdkmansry = false + if (SBLocation.area != Area.Dungeon) return mc.theWorld.loadedEntityList.forEach { entity -> if (entity is EntityArmorStand && entity.customNameTag.contains("✯") && !markedArmorStands.contains(entity)) { if (config.starredHighlight == 0) return@forEach diff --git a/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonReady.kt b/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonReady.kt index 3defe7c..76488b1 100644 --- a/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonReady.kt +++ b/src/main/kotlin/com/ambientaddons/features/dungeon/DungeonReady.kt @@ -6,9 +6,8 @@ import com.ambientaddons.utils.Extensions.chest import com.ambientaddons.utils.Extensions.items import com.ambientaddons.utils.Extensions.stripControlCodes import com.ambientaddons.utils.Area -import com.ambientaddons.utils.SkyBlock +import com.ambientaddons.utils.SBLocation import com.ambientaddons.utils.dungeon.DungeonPlayers -import gg.essential.universal.UChat import net.minecraftforge.client.event.GuiScreenEvent import net.minecraftforge.event.world.WorldEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -28,7 +27,7 @@ object DungeonReady { @SubscribeEvent fun onGuiDraw(event: GuiScreenEvent.DrawScreenEvent) { - if (config.autoReady == 0 || SkyBlock.area != Area.Dungeon) return + if (config.autoReady == 0 || SBLocation.area != Area.Dungeon) return val chest = event.gui?.chest ?: return val chestName = chest.lowerChestInventory.name if (chestName == "Start Dungeon?" && !hasClickedStart) { diff --git a/src/main/kotlin/com/ambientaddons/features/dungeon/IgnoreCarpet.kt b/src/main/kotlin/com/ambientaddons/features/dungeon/IgnoreCarpet.kt index 6f2281e..438ad67 100644 --- a/src/main/kotlin/com/ambientaddons/features/dungeon/IgnoreCarpet.kt +++ b/src/main/kotlin/com/ambientaddons/features/dungeon/IgnoreCarpet.kt @@ -1,11 +1,11 @@ package com.ambientaddons.features.dungeon import AmbientAddons.Companion.config -import com.ambientaddons.utils.SkyBlock +import com.ambientaddons.utils.SBLocation object IgnoreCarpet { fun shouldIgnoreCarpet(): Boolean { - if (!SkyBlock.inSkyblock) return false + if (!SBLocation.inSkyblock) return false return if (AmbientAddons.isInitialized()) config.ignoreCarpet else false } }
\ No newline at end of file diff --git a/src/main/kotlin/com/ambientaddons/features/dungeon/ShortbowClicker.kt b/src/main/kotlin/com/ambientaddons/features/dungeon/ShortbowClicker.kt index 9ff5d48..7cce15d 100644 --- a/src/main/kotlin/com/ambientaddons/features/dungeon/ShortbowClicker.kt +++ b/src/main/kotlin/com/ambientaddons/features/dungeon/ShortbowClicker.kt @@ -3,7 +3,7 @@ package com.ambientaddons.features.dungeon import AmbientAddons.Companion.config import AmbientAddons.Companion.mc import com.ambientaddons.utils.Extensions.skyblockID -import com.ambientaddons.utils.SkyBlock +import com.ambientaddons.utils.SBLocation import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.math.roundToLong @@ -15,7 +15,7 @@ object ShortbowClicker { @SubscribeEvent fun onRender(event: RenderWorldLastEvent) { - if (!SkyBlock.inSkyblock) return + if (!SBLocation.inSkyblock) return if (config.terminatorCps == 0) return if (!mc.gameSettings.keyBindUseItem.isKeyDown) return val itemStack = mc.thePlayer?.inventory?.getCurrentItem() 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 74b23e7..f867b3f 100644 --- a/src/main/kotlin/com/ambientaddons/features/dungeon/terminals/MelodyHelper.kt +++ b/src/main/kotlin/com/ambientaddons/features/dungeon/terminals/MelodyHelper.kt @@ -6,7 +6,7 @@ import com.ambientaddons.events.GuiContainerEvent import com.ambientaddons.utils.Extensions.chest import com.ambientaddons.utils.Extensions.items import com.ambientaddons.utils.Extensions.stripControlCodes -import com.ambientaddons.utils.SkyBlock +import com.ambientaddons.utils.SBLocation import net.minecraftforge.client.event.ClientChatReceivedEvent import net.minecraftforge.client.event.GuiOpenEvent import net.minecraftforge.event.world.WorldEvent @@ -27,7 +27,7 @@ object MelodyHelper { @SubscribeEvent fun onChat(event: ClientChatReceivedEvent) { - if (SkyBlock.dungeonFloor?.floor != 7) return + if (SBLocation.dungeonFloor?.floor != 7) return val unformatted = event.message.unformattedText.stripControlCodes() if (completedStageRegex.matches(unformatted)) { hasSaidMeowlody = false @@ -44,7 +44,7 @@ object MelodyHelper { @SubscribeEvent fun onGuiOpen(event: GuiOpenEvent) { - if (SkyBlock.dungeonFloor?.floor != 7) return + if (SBLocation.dungeonFloor?.floor != 7) return if (event.gui == null) return if (event.gui.chest?.lowerChestInventory?.name == "Click the button on time!") { if (!hasSaidMeowlody && config.melodyAnnouncement.isNotBlank()) { @@ -56,7 +56,7 @@ object MelodyHelper { @SubscribeEvent fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) { - if (SkyBlock.dungeonFloor?.floor != 7) return + if (SBLocation.dungeonFloor?.floor != 7) return val chest = event.gui.chest?.lowerChestInventory if (chest?.name != "Click the button on time!" || isThrottled) return val colors = chest.items.map { it?.itemDamage } |