aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin')
-rw-r--r--src/main/kotlin/com/ambientaddons/AmbientAddons.kt8
-rw-r--r--src/main/kotlin/com/ambientaddons/config/Config.kt6
-rw-r--r--src/main/kotlin/com/ambientaddons/events/BossStatusEvent.kt8
-rw-r--r--src/main/kotlin/com/ambientaddons/features/kuudra/KuudraHp.kt25
-rw-r--r--src/main/kotlin/com/ambientaddons/features/kuudra/KuudraReady.kt (renamed from src/main/kotlin/com/ambientaddons/features/misc/KuudraReady.kt)2
-rw-r--r--src/main/kotlin/com/ambientaddons/features/misc/BonzoMask.kt2
-rw-r--r--src/main/kotlin/com/ambientaddons/utils/Timer.kt30
7 files changed, 77 insertions, 4 deletions
diff --git a/src/main/kotlin/com/ambientaddons/AmbientAddons.kt b/src/main/kotlin/com/ambientaddons/AmbientAddons.kt
index 57ded8a..406cc41 100644
--- a/src/main/kotlin/com/ambientaddons/AmbientAddons.kt
+++ b/src/main/kotlin/com/ambientaddons/AmbientAddons.kt
@@ -10,6 +10,8 @@ import com.ambientaddons.features.dungeon.*
import com.ambientaddons.features.dungeon.terminals.MelodyHelper
import com.ambientaddons.features.keybinds.PerspectiveKeybind
import com.ambientaddons.features.keybinds.SendLastMessageKeybind
+import com.ambientaddons.features.kuudra.KuudraReady
+import com.ambientaddons.features.kuudra.KuudraHp
import com.ambientaddons.features.misc.*
import com.ambientaddons.gui.GuiElement
import com.ambientaddons.utils.SBLocation
@@ -74,13 +76,15 @@ class AmbientAddons {
CrimsonFishing,
CatOverlay,
PingOverlay,
- ThornOverlay
+ ThornOverlay,
+ KuudraHp
).forEach(MinecraftForge.EVENT_BUS::register)
keyBinds.values.forEach(ClientRegistry::registerKeyBinding)
guiElements = listOf(
CatOverlay.element,
PingOverlay.element,
- ThornOverlay.element
+ ThornOverlay.element,
+ KuudraHp.element
)
}
diff --git a/src/main/kotlin/com/ambientaddons/config/Config.kt b/src/main/kotlin/com/ambientaddons/config/Config.kt
index 753d401..8c20b46 100644
--- a/src/main/kotlin/com/ambientaddons/config/Config.kt
+++ b/src/main/kotlin/com/ambientaddons/config/Config.kt
@@ -13,6 +13,7 @@ object Config : Vigilant(
var kuudraReady = false
+ var kuudraHp = false
var autoTrapper = false
var trapperEsp = false
@@ -58,6 +59,11 @@ object Config : Vigilant(
name = "Automatically ready in Kuudra",
description = "Automatically clicks the ready pane when the ready GUI is opened."
)
+ switch(
+ ::kuudraHp,
+ name = "Show Kuudra health",
+ description = "Shows Kuudra health percentage in boss bar.",
+ )
}
subcategory("Trevor the Trapper") {
switch(
diff --git a/src/main/kotlin/com/ambientaddons/events/BossStatusEvent.kt b/src/main/kotlin/com/ambientaddons/events/BossStatusEvent.kt
new file mode 100644
index 0000000..cefd993
--- /dev/null
+++ b/src/main/kotlin/com/ambientaddons/events/BossStatusEvent.kt
@@ -0,0 +1,8 @@
+package com.ambientaddons.events
+
+import net.minecraft.entity.boss.IBossDisplayData
+import net.minecraftforge.fml.common.eventhandler.Cancelable
+import net.minecraftforge.fml.common.eventhandler.Event
+
+@Cancelable
+class BossStatusEvent(val displayData: IBossDisplayData, val hasColorModifierIn: Boolean) : Event() \ No newline at end of file
diff --git a/src/main/kotlin/com/ambientaddons/features/kuudra/KuudraHp.kt b/src/main/kotlin/com/ambientaddons/features/kuudra/KuudraHp.kt
new file mode 100644
index 0000000..79f6428
--- /dev/null
+++ b/src/main/kotlin/com/ambientaddons/features/kuudra/KuudraHp.kt
@@ -0,0 +1,25 @@
+package com.ambientaddons.features.kuudra
+
+import AmbientAddons.Companion.config
+import com.ambientaddons.events.BossStatusEvent
+import com.ambientaddons.gui.GuiElement
+import com.ambientaddons.utils.Area
+import com.ambientaddons.utils.Extensions.stripControlCodes
+import com.ambientaddons.utils.SBLocation
+import net.minecraft.entity.boss.BossStatus
+import net.minecraftforge.client.event.ClientChatReceivedEvent
+import net.minecraftforge.client.event.RenderGameOverlayEvent
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+object KuudraHp {
+
+ fun onBossBarSet(event: BossStatusEvent) {
+ if (!config.kuudraHp || SBLocation.area != Area.Kuudra) return
+ val bossData = event.displayData
+ if (bossData.displayName.unformattedText.stripControlCodes().contains("Kuudra")) {
+ BossStatus.healthScale = bossData.health / bossData.maxHealth
+ BossStatus.statusBarTime = 100
+ BossStatus.bossName = "${bossData.displayName.formattedText} §r§8 - §r§d ${S}"
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/kotlin/com/ambientaddons/features/misc/KuudraReady.kt b/src/main/kotlin/com/ambientaddons/features/kuudra/KuudraReady.kt
index d9be1dd..8133182 100644
--- a/src/main/kotlin/com/ambientaddons/features/misc/KuudraReady.kt
+++ b/src/main/kotlin/com/ambientaddons/features/kuudra/KuudraReady.kt
@@ -1,4 +1,4 @@
-package com.ambientaddons.features.misc
+package com.ambientaddons.features.kuudra
import AmbientAddons.Companion.config
import AmbientAddons.Companion.mc
diff --git a/src/main/kotlin/com/ambientaddons/features/misc/BonzoMask.kt b/src/main/kotlin/com/ambientaddons/features/misc/BonzoMask.kt
index 2e8be9e..022a435 100644
--- a/src/main/kotlin/com/ambientaddons/features/misc/BonzoMask.kt
+++ b/src/main/kotlin/com/ambientaddons/features/misc/BonzoMask.kt
@@ -38,7 +38,7 @@ object BonzoMask {
else -> false
}
if (config.maskWarning && didMaskProc) {
- mc.ingameGUI.displayTitle("§cMask!", null, 5, 20, 5)
+ mc.ingameGUI.displayTitle("§cMask!", null, 5, 40, 5)
}
}
diff --git a/src/main/kotlin/com/ambientaddons/utils/Timer.kt b/src/main/kotlin/com/ambientaddons/utils/Timer.kt
new file mode 100644
index 0000000..dab30b2
--- /dev/null
+++ b/src/main/kotlin/com/ambientaddons/utils/Timer.kt
@@ -0,0 +1,30 @@
+package com.ambientaddons.utils
+
+class Timer {
+ private var previousTime: Long = 0
+ private var startTime: Long? = null
+
+ var isRunning: Boolean = false
+ private set
+
+ private val sessionTime: Long
+ get() {
+ return startTime?.let { System.currentTimeMillis() - it } ?: 0
+ }
+
+ private val time: Long
+ get() {
+ return sessionTime?.let { it + previousTime } ?: 0
+ }
+
+ fun start() {
+ isRunning = true
+ startTime = System.currentTimeMillis()
+ }
+
+ fun stop() {
+ isRunning = false
+ previousTime = sessionTime
+ startTime = null
+ }
+} \ No newline at end of file