aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-16 20:04:29 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-16 20:04:29 +0100
commitf007eb5fd10b51f74ddae2b13688bd86bf8f786c (patch)
tree1bbf60bd8ecc6e1a92c99c81805aaaba2a29927a /src/main/java
parent7a7f1b9acb5990b24b8aeea5a435c136bb1bb7db (diff)
downloadskyhanni-f007eb5fd10b51f74ddae2b13688bd86bf8f786c.tar.gz
skyhanni-f007eb5fd10b51f74ddae2b13688bd86bf8f786c.tar.bz2
skyhanni-f007eb5fd10b51f74ddae2b13688bd86bf8f786c.zip
Added King's Scent from goblin king in crystal hollows to the non god pot list
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt
index 7ae821011..52854ae93 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt
@@ -12,6 +12,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.sorted
import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings
import at.hannibal2.skyhanni.utils.TimeUnit
import at.hannibal2.skyhanni.utils.TimeUtils
+import net.minecraft.client.Minecraft
import net.minecraft.network.play.server.S30PacketWindowItems
import net.minecraft.network.play.server.S47PacketPlayerListHeaderFooter
import net.minecraftforge.event.world.WorldEvent
@@ -31,6 +32,7 @@ class NonGodPotEffectDisplay {
"smoldering_polarization" to "§aSmoldering Polarization I",
"mushed_glowy_tonic" to "§2Mushed Glowy Tonic I",
"wisp_ice" to "§bWisp's Ice-Flavored Water I",
+ "goblin_king_scent" to "§2King's Scent I",
"invisibility" to "§8Invisibility I", // when wearing sorrow armor
@@ -48,26 +50,39 @@ class NonGodPotEffectDisplay {
@SubscribeEvent
fun onChatMessage(event: LorenzChatEvent) {
+ if (event.message == "§aYou cleared all of your active effects!") {
+ activeEffects.clear()
+ update()
+ }
+
if (event.message == "§aYou ate a §r§aRe-heated Gummy Polar Bear§r§a!") {
checkFooter = true
activeEffects["§aSmoldering Polarization I"] = System.currentTimeMillis() + 1000 * 60 * 60
- format()
+ update()
}
if (event.message == "§a§lBUFF! §fYou have gained §r§2Mushed Glowy Tonic I§r§f! Press TAB or type /effects to view your active effects!") {
checkFooter = true
activeEffects["§2Mushed Glowy Tonic I"] = System.currentTimeMillis() + 1000 * 60 * 60
- format()
+ update()
}
if (event.message == "§a§lBUFF! §fYou splashed yourself with §r§bWisp's Ice-Flavored Water I§r§f! Press TAB or type /effects to view your active effects!") {
checkFooter = true
activeEffects["§bWisp's Ice-Flavored Water I"] = System.currentTimeMillis() + 1000 * 60 * 5
- format()
+ update()
+ }
+
+
+ val name = Minecraft.getMinecraft().thePlayer.displayName
+ if (event.message == "§e[NPC] §6King Yolkar§f: §rWell done, $name§r!") {
+ checkFooter = true
+ activeEffects["§2King's Scent I"] = System.currentTimeMillis() + 1000 * 60 * 20
+ update()
}
}
- private fun format() {
+ private fun update() {
val now = System.currentTimeMillis()
display.clear()
if (activeEffects.values.removeIf { now > it }) {
@@ -115,7 +130,7 @@ class NonGodPotEffectDisplay {
if (lastTick + 1_000 > System.currentTimeMillis()) return
lastTick = System.currentTimeMillis()
- format()
+ update()
}
@SubscribeEvent
@@ -134,7 +149,7 @@ class NonGodPotEffectDisplay {
if (line.contains("Remaining")) {
val duration = TimeUtils.getMillis(line.split("§f")[1])
activeEffects[name] = System.currentTimeMillis() + duration
- format()
+ update()
}
}
}
@@ -154,7 +169,7 @@ class NonGodPotEffectDisplay {
if (line.startsWith("§2Mushed Glowy Tonic I")) {
val duration = TimeUtils.getMillis(line.split("§f")[1])
activeEffects["§2Mushed Glowy Tonic I"] = System.currentTimeMillis() + duration
- format()
+ update()
}
val matcher = patternEffectsCount.matcher(line)
if (matcher.matches()) {