diff options
author | inglettronald <inglettronald@gmail.com> | 2023-02-23 02:30:32 -0600 |
---|---|---|
committer | inglettronald <inglettronald@gmail.com> | 2023-02-23 02:30:32 -0600 |
commit | f0c36d2586a46dbe48d745866fbd62e74aa466c6 (patch) | |
tree | 6b155148c7d6b9bb3f0c584ff8eee91cf695c63b /src/main/kotlin/dulkirmod/features | |
parent | 7df778d6ac01a6d350608a5962b9344493444ebc (diff) | |
download | DulkirMod-f0c36d2586a46dbe48d745866fbd62e74aa466c6.tar.gz DulkirMod-f0c36d2586a46dbe48d745866fbd62e74aa466c6.tar.bz2 DulkirMod-f0c36d2586a46dbe48d745866fbd62e74aa466c6.zip |
Major tablist-related refactor and Garden notification stuff
Diffstat (limited to 'src/main/kotlin/dulkirmod/features')
6 files changed, 45 insertions, 30 deletions
diff --git a/src/main/kotlin/dulkirmod/features/BrokenHypeNotif.kt b/src/main/kotlin/dulkirmod/features/BrokenHypeNotif.kt index 668751c..27225ff 100644 --- a/src/main/kotlin/dulkirmod/features/BrokenHypeNotif.kt +++ b/src/main/kotlin/dulkirmod/features/BrokenHypeNotif.kt @@ -3,6 +3,7 @@ package dulkirmod.features import dulkirmod.DulkirMod import dulkirmod.DulkirMod.Companion.mc import dulkirmod.config.Config +import dulkirmod.utils.TabListUtils import dulkirmod.utils.Utils import net.minecraft.item.ItemStack import net.minecraft.nbt.NBTTagCompound @@ -57,7 +58,7 @@ fun brokenHypeNotif() { } // If this section of the code is reached, then we have the same item, and we can check for updated stats - if (oldKill != kill && oldChampionXp == championXp && Utils.area != "Private Island") { + if (oldKill != kill && oldChampionXp == championXp && TabListUtils.area != "Private Island") { mc.thePlayer.playSound("random.anvil_land", 1f * Config.bestiaryNotifVol, 0f) val color = Utils.getColorString(Config.bestiaryNotifColor) DulkirMod.titleUtils.drawStringForTime("${color}Hype Broken", 5000) diff --git a/src/main/kotlin/dulkirmod/features/GardenVisitorAlert.kt b/src/main/kotlin/dulkirmod/features/GardenVisitorAlert.kt new file mode 100644 index 0000000..1292b7e --- /dev/null +++ b/src/main/kotlin/dulkirmod/features/GardenVisitorAlert.kt @@ -0,0 +1,28 @@ +package dulkirmod.features + +import dulkirmod.DulkirMod +import dulkirmod.config.Config +import dulkirmod.utils.TabListUtils +import dulkirmod.utils.Utils + +class GardenVisitorAlert { + var hasSentAlert = false + + fun alert() { + if (!Config.notifyMaxVisitors) return + if (!Utils.isInSkyblock()) return + + if (TabListUtils.area != "Garden") { + hasSentAlert = false + } + + if (TabListUtils.maxVisitors && !hasSentAlert) { + val color = Utils.getColorString(Config.bestiaryNotifColor) + DulkirMod.titleUtils.drawStringForTime("${color}Max Visitors", 5000) + DulkirMod.mc.thePlayer.playSound("mob.cat.meow", 1f * Config.bestiaryNotifVol, 1f) + hasSentAlert = true + } else if (!TabListUtils.maxVisitors) hasSentAlert = false + + } + +}
\ No newline at end of file diff --git a/src/main/kotlin/dulkirmod/features/KeeperWaypoints.kt b/src/main/kotlin/dulkirmod/features/KeeperWaypoints.kt index 7b82fa2..bb053a3 100644 --- a/src/main/kotlin/dulkirmod/features/KeeperWaypoints.kt +++ b/src/main/kotlin/dulkirmod/features/KeeperWaypoints.kt @@ -2,6 +2,7 @@ package dulkirmod.features import dulkirmod.DulkirMod.Companion.mc import dulkirmod.config.Config +import dulkirmod.utils.TabListUtils import dulkirmod.utils.Utils import dulkirmod.utils.WorldRenderUtils import net.minecraft.util.Vec3 @@ -13,7 +14,7 @@ class KeeperWaypoints { @SubscribeEvent fun onWorldRenderLast(event: RenderWorldLastEvent) { if (!Config.keeperWaypoints) return - if (Utils.area != "Spider's Den") return + if (TabListUtils.area != "Spider's Den") return val vec1 = Vec3(-208.5, 44.5, -259.5) val vec2 = Vec3(-311.5, 43.5, -232.5) diff --git a/src/main/kotlin/dulkirmod/features/MatchoAlert.kt b/src/main/kotlin/dulkirmod/features/MatchoAlert.kt index c140036..db51a48 100644 --- a/src/main/kotlin/dulkirmod/features/MatchoAlert.kt +++ b/src/main/kotlin/dulkirmod/features/MatchoAlert.kt @@ -13,31 +13,16 @@ class MatchoAlert { if (!Config.notifyMatcho) return if (!Utils.isInSkyblock()) return - val scoreboardList: List<String?> = TabListUtils.fetchTabEntires().map { - it.displayName?.unformattedText + if (TabListUtils.area != "Crimson Isle") { + hasSentAlert = false } - 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 - } - } - } + if (TabListUtils.explosivity && !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 (!TabListUtils.explosivity) hasSentAlert = 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 5dd190a..d509d1d 100644 --- a/src/main/kotlin/dulkirmod/features/NametagCleaner.kt +++ b/src/main/kotlin/dulkirmod/features/NametagCleaner.kt @@ -2,7 +2,7 @@ package dulkirmod.features import dulkirmod.DulkirMod.Companion.config import dulkirmod.DulkirMod.Companion.mc -import dulkirmod.utils.Utils +import dulkirmod.utils.TabListUtils import dulkirmod.utils.Utils.stripColorCodes import net.minecraft.entity.item.EntityArmorStand import net.minecraftforge.client.event.RenderLivingEvent @@ -32,7 +32,7 @@ object NametagCleaner { } } - if (config.keeperFocus && Utils.area == "Spider's Den") { + if (config.keeperFocus && TabListUtils.area == "Spider's Den") { val name = stripColorCodes(event.entity.customNameTag) if (!name.contains("Keeper")) mc.theWorld.removeEntity(event.entity) diff --git a/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt b/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt index f6a90eb..fbd2437 100644 --- a/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt +++ b/src/main/kotlin/dulkirmod/features/chat/ThrottleNotif.kt @@ -2,15 +2,15 @@ package dulkirmod.features.chat import dulkirmod.DulkirMod import dulkirmod.config.Config +import dulkirmod.utils.TabListUtils import dulkirmod.utils.TextUtils -import dulkirmod.utils.Utils import net.minecraftforge.client.event.ClientChatReceivedEvent object ThrottleNotif { private var lastThrottle: Long = 0 fun handle(event: ClientChatReceivedEvent, unformatted: String) { if (unformatted == "This menu has been throttled! Please slow down..." && DulkirMod.config.throttleNotifier - && Utils.isInDungeons() + && TabListUtils.isInDungeons ) { event.isCanceled = true if (!Config.throttleNotifierSpam && System.currentTimeMillis() - lastThrottle > 8000) { |