diff options
Diffstat (limited to 'src/main/kotlin/dulkirmod/features')
-rw-r--r-- | src/main/kotlin/dulkirmod/features/ArachneTimer.kt | 22 | ||||
-rw-r--r-- | src/main/kotlin/dulkirmod/features/BrokenHypeNotif.kt | 8 | ||||
-rw-r--r-- | src/main/kotlin/dulkirmod/features/MatchoAlert.kt | 43 |
3 files changed, 67 insertions, 6 deletions
diff --git a/src/main/kotlin/dulkirmod/features/ArachneTimer.kt b/src/main/kotlin/dulkirmod/features/ArachneTimer.kt index 7e0f144..d5334ba 100644 --- a/src/main/kotlin/dulkirmod/features/ArachneTimer.kt +++ b/src/main/kotlin/dulkirmod/features/ArachneTimer.kt @@ -4,14 +4,18 @@ import dulkirmod.DulkirMod import dulkirmod.DulkirMod.Companion.mc import dulkirmod.config.Config import dulkirmod.utils.Utils +import dulkirmod.utils.WorldRenderUtils import net.minecraft.util.ChatComponentText +import net.minecraft.util.Vec3 import net.minecraftforge.client.event.ClientChatReceivedEvent +import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class ArachneTimer { - private var startmillis : Long = -1; - private var endmillis : Long = -1; + private var startmillis : Long = -1 + private var endmillis : Long = -1 + private var spawnmillis : Long = -1 @SubscribeEvent(receiveCanceled = true, priority = EventPriority.LOW) fun onChat(event: ClientChatReceivedEvent) { @@ -27,6 +31,9 @@ class ArachneTimer { if (unformatted == "[BOSS] Arachne: You dare to call me, the queen of the dark, to you. I'll accept no excuses, you shall die!") { startmillis = System.currentTimeMillis() } + else if (unformatted.startsWith('☄') && unformatted.contains("Something is awakening!")) { + spawnmillis = System.currentTimeMillis() + } if (unformatted == "[BOSS] Arachne: You are lucky this time that you only called out a portion of my power. If you dared to face me at my peak, you would not survive!") { endmillis = System.currentTimeMillis() @@ -39,4 +46,15 @@ class ArachneTimer { } } } + @SubscribeEvent + fun onWorldRenderLast(event: RenderWorldLastEvent) { + if (!Config.arachneSpawnTimer) return + + if (spawnmillis > startmillis) { + val color = Utils.getColorString(Config.bestiaryNotifColor) + var time = 18 - (System.currentTimeMillis() - spawnmillis)/1000 + if (time < 0) time = 0 + WorldRenderUtils.render(Vec3(-282.5, 50.8, -178.5), "${color}${time}") + } + } }
\ No newline at end of file diff --git a/src/main/kotlin/dulkirmod/features/BrokenHypeNotif.kt b/src/main/kotlin/dulkirmod/features/BrokenHypeNotif.kt index b748f8b..d516fcf 100644 --- a/src/main/kotlin/dulkirmod/features/BrokenHypeNotif.kt +++ b/src/main/kotlin/dulkirmod/features/BrokenHypeNotif.kt @@ -8,14 +8,14 @@ import net.minecraft.item.ItemStack import net.minecraft.nbt.NBTTagCompound var oldKill = -1 -var oldChampionXp = -1 +var oldChampionXp = -1.0 var oldID = "" fun brokenHypeNotif() { if (!Config.notifyHype) return; var kill = -1 - var championXp = -1 + var championXp = -1.0 var id = "" if (mc.thePlayer == null) return @@ -34,7 +34,7 @@ fun brokenHypeNotif() { kill = ea.getInteger("stats_book") } if (ea.hasKey("champion_combat_xp", 99)) { - championXp = ea.getDouble("champion_combat_xp").toInt() + championXp = ea.getDouble("champion_combat_xp") } } } @@ -46,7 +46,7 @@ fun brokenHypeNotif() { // Check if this is a valid item for testing whether bestiary is broken. // That is, to be specific, check that it has champion and book of stats. // If it doesn't, don't reset because it can't be used anyway. - if (kill == -1 || championXp == -1) { + if (kill == -1 || championXp == -1.0) { return; } // If we get here this is a new item that is legitimate for testing bugged xp, in theory. diff --git a/src/main/kotlin/dulkirmod/features/MatchoAlert.kt b/src/main/kotlin/dulkirmod/features/MatchoAlert.kt new file mode 100644 index 0000000..f713372 --- /dev/null +++ b/src/main/kotlin/dulkirmod/features/MatchoAlert.kt @@ -0,0 +1,43 @@ +package dulkirmod.features + +import dulkirmod.DulkirMod +import dulkirmod.config.Config +import dulkirmod.utils.TabListUtils +import dulkirmod.utils.Utils + +class MatchoAlert() { + + var hasSentAlert = false + + fun alert() { + if (!Config.notifyMatcho) return + if (!Utils.isInSkyblock()) return + + val scoreboardList: List<String?> = TabListUtils.fetchTabEntires().map { + it.displayName?.unformattedText + } + + var explo = false + for (s in scoreboardList) { + if (explo) { + // This line is status of Volcano + if (s != " INACTIVE" && !hasSentAlert) { + val color = Utils.getColorString(Config.bestiaryNotifColor) + DulkirMod.titleUtils.drawStringForTime("${color}Matcho", 5000) + if (Config.bestiaryAlertSounds) + DulkirMod.mc.thePlayer.playSound("mob.villager.yes", 1f * Config.bestiaryNotifVol, 0f) + hasSentAlert = true; + } else if (s == " INACTIVE") hasSentAlert = false + break; + } + if (s == "Volcano Explosivity:") + explo = true + if (s != null) { + if (s.contains("Area:") && !s.contains("Crimson Isle")) { + hasSentAlert = false + break; + } + } + } + } +}
\ No newline at end of file |