aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/ambientaddons/features/misc
diff options
context:
space:
mode:
authorAppability <appable@icloud.com>2022-10-13 18:58:00 -0700
committerAppability <appable@icloud.com>2022-10-13 18:58:00 -0700
commitd0cbc11018c8126575117aaeb2b861957386fa9a (patch)
treec5419fb1f00b147604bded231c1388d6b391d27e /src/main/kotlin/com/ambientaddons/features/misc
parentc599ee0d78ed8bc17488636f2d9b9b1d5b6dd4a8 (diff)
downloadAmbientAddons-d0cbc11018c8126575117aaeb2b861957386fa9a.tar.gz
AmbientAddons-d0cbc11018c8126575117aaeb2b861957386fa9a.tar.bz2
AmbientAddons-d0cbc11018c8126575117aaeb2b861957386fa9a.zip
steal a bunch of code from sbc! +melodyhelper, kuudra ready, wither shield overlay
Diffstat (limited to 'src/main/kotlin/com/ambientaddons/features/misc')
-rw-r--r--src/main/kotlin/com/ambientaddons/features/misc/BonzoMask.kt4
-rw-r--r--src/main/kotlin/com/ambientaddons/features/misc/KuudraReady.kt37
2 files changed, 39 insertions, 2 deletions
diff --git a/src/main/kotlin/com/ambientaddons/features/misc/BonzoMask.kt b/src/main/kotlin/com/ambientaddons/features/misc/BonzoMask.kt
index db45e93..b0689c4 100644
--- a/src/main/kotlin/com/ambientaddons/features/misc/BonzoMask.kt
+++ b/src/main/kotlin/com/ambientaddons/features/misc/BonzoMask.kt
@@ -6,7 +6,7 @@ import com.ambientaddons.events.ItemOverlayEvent
import com.ambientaddons.utils.Extensions.skyblockID
import com.ambientaddons.utils.Extensions.stripControlCodes
import com.ambientaddons.utils.SkyBlock
-import com.ambientaddons.utils.RenderUtils
+import com.ambientaddons.utils.render.OverlayUtils
import net.minecraftforge.client.event.ClientChatReceivedEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -52,7 +52,7 @@ object BonzoMask {
else -> 1.0
}
if (durability < 1.0) {
- RenderUtils.renderDurabilityBar(event.x, event.y, durability)
+ OverlayUtils.renderDurabilityBar(event.x, event.y, durability)
}
}
diff --git a/src/main/kotlin/com/ambientaddons/features/misc/KuudraReady.kt b/src/main/kotlin/com/ambientaddons/features/misc/KuudraReady.kt
new file mode 100644
index 0000000..469d6fe
--- /dev/null
+++ b/src/main/kotlin/com/ambientaddons/features/misc/KuudraReady.kt
@@ -0,0 +1,37 @@
+package com.ambientaddons.features.misc
+
+import AmbientAddons.Companion.config
+import AmbientAddons.Companion.mc
+import com.ambientaddons.utils.Area
+import com.ambientaddons.utils.Extensions.chest
+import com.ambientaddons.utils.Extensions.items
+import com.ambientaddons.utils.Extensions.lore
+import com.ambientaddons.utils.Extensions.stripControlCodes
+import com.ambientaddons.utils.SkyBlock
+import com.ambientaddons.utils.dungeon.DungeonPlayers
+import net.minecraftforge.client.event.GuiScreenEvent
+import net.minecraftforge.event.world.WorldEvent
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+object KuudraReady {
+ private var hasClickedReady = false
+
+ @SubscribeEvent
+ fun onWorldUnload(event: WorldEvent.Unload) {
+ hasClickedReady = false
+ }
+
+ @SubscribeEvent
+ fun onGuiDraw(event: GuiScreenEvent.DrawScreenEvent) {
+ if (!config.kuudraReady || SkyBlock.area != Area.Kuudra) return
+ val chest = event.gui?.chest ?: return
+ val chestName = chest.lowerChestInventory.name
+ if (chestName == "Ready Up" && !hasClickedReady) {
+ val clickIndex = chest.lowerChestInventory.items.takeIf { it.last() != null }?.indexOfFirst {
+ it?.lore?.getOrNull(0)?.stripControlCodes()?.startsWith("Click to mark yourself") == true
+ } ?: return
+ hasClickedReady = true
+ mc.playerController.windowClick(chest.windowId, clickIndex, 2, 3, mc.thePlayer)
+ }
+ }
+} \ No newline at end of file