From c8d6e3c6da442e6e30b9547e6c7e87786db83ade Mon Sep 17 00:00:00 2001 From: ingle Date: Wed, 9 Nov 2022 11:41:29 -0600 Subject: -fixed arachne functions --- src/main/kotlin/dulkirmod/DulkirMod.kt | 2 +- src/main/kotlin/dulkirmod/features/ArachneTimer.kt | 18 +++++++++++++----- src/main/kotlin/dulkirmod/features/NametagCleaner.kt | 3 ++- 3 files changed, 16 insertions(+), 7 deletions(-) (limited to 'src/main/kotlin/dulkirmod') diff --git a/src/main/kotlin/dulkirmod/DulkirMod.kt b/src/main/kotlin/dulkirmod/DulkirMod.kt index 11ffafa..e4270e8 100644 --- a/src/main/kotlin/dulkirmod/DulkirMod.kt +++ b/src/main/kotlin/dulkirmod/DulkirMod.kt @@ -114,7 +114,7 @@ class DulkirMod { companion object { const val MOD_ID = "dulkirmod" const val MOD_NAME = "Dulkir Mod" - const val MOD_VERSION = "1.1.0" + const val MOD_VERSION = "1.1.1" const val CHAT_PREFIX = "§f<§3DulkirMod§f>" val mc: Minecraft = Minecraft.getMinecraft() diff --git a/src/main/kotlin/dulkirmod/features/ArachneTimer.kt b/src/main/kotlin/dulkirmod/features/ArachneTimer.kt index 4e4ae66..9089f5c 100644 --- a/src/main/kotlin/dulkirmod/features/ArachneTimer.kt +++ b/src/main/kotlin/dulkirmod/features/ArachneTimer.kt @@ -16,6 +16,7 @@ class ArachneTimer { private var startmillis: Long = -1 private var endmillis: Long = -1 private var spawnmillis: Long = -1 + private var bigboy: Boolean = false @SubscribeEvent(receiveCanceled = true, priority = EventPriority.LOW) fun onChat(event: ClientChatReceivedEvent) { @@ -28,19 +29,21 @@ class ArachneTimer { } val unformatted = Utils.stripColorCodes(event.message.unformattedText) - if (unformatted == "[BOSS] Arachne: You dare to call me, the queen of the dark, to you. I'll accept no excuses, you shall die!") { + if (unformatted == "[BOSS] Arachne: With your sacrifice." || unformatted == "[BOSS] Arachne: A befitting welcome!") { + bigboy = false startmillis = System.currentTimeMillis() } else if (unformatted.startsWith('☄') && unformatted.contains("Something is awakening!")) { + if (unformatted.contains("Arachne Crystal!")) bigboy = true 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!") { + if (unformatted.startsWith(" Runecrafting:")) { endmillis = System.currentTimeMillis() if (startmillis > -1) { killtime = (endmillis - startmillis).toFloat() / 1000 mc.thePlayer.addChatMessage( - ChatComponentText("${DulkirMod.CHAT_PREFIX} §6Arachne took §7$killtime §6seconds to kill.") + ChatComponentText(" ${DulkirMod.CHAT_PREFIX} §6Arachne took §7$killtime §6seconds to kill.") ) } } @@ -52,9 +55,14 @@ class ArachneTimer { if (spawnmillis > startmillis) { val color = Utils.getColorString(Config.bestiaryNotifColor) - var time = 18 - (System.currentTimeMillis() - spawnmillis) / 1000 + var time: Int + time = if (bigboy) { + (40 - (System.currentTimeMillis() - spawnmillis) / 1000).toInt() + } else { + (18 - (System.currentTimeMillis() - spawnmillis) / 1000).toInt() + } if (time < 0) time = 0 - WorldRenderUtils.render(Vec3(-282.5, 50.8, -178.5), "${color}${time}") + WorldRenderUtils.render(Vec3(-282.5, 50.8, -178.5), "${color}${time}", false) } } } \ No newline at end of file diff --git a/src/main/kotlin/dulkirmod/features/NametagCleaner.kt b/src/main/kotlin/dulkirmod/features/NametagCleaner.kt index b847bf1..e2e4a04 100644 --- a/src/main/kotlin/dulkirmod/features/NametagCleaner.kt +++ b/src/main/kotlin/dulkirmod/features/NametagCleaner.kt @@ -25,7 +25,8 @@ object NametagCleaner { if (config.hideArachneTags) { val name = stripColorCodes(event.entity.customNameTag) - if (name.contains("Luxurious Spool") || name.contains("String") || name.contains("Arachne Fragment")) { + if (name.contains("Luxurious Spool") || name.contains("String") || name.contains("Arachne Fragment") + || name.contains("Spider Eye")) { mc.theWorld.removeEntity(event.entity) } } -- cgit