diff --git a/src/main/kotlin/me/odinmain/clickgui/settings/impl/HUDSetting.kt b/src/main/kotlin/me/odinmain/clickgui/settings/impl/HUDSetting.kt index cca21ddda..1c5b4809b 100644 --- a/src/main/kotlin/me/odinmain/clickgui/settings/impl/HUDSetting.kt +++ b/src/main/kotlin/me/odinmain/clickgui/settings/impl/HUDSetting.kt @@ -24,8 +24,8 @@ class HUDSetting( val module: Module, ) : RenderableSetting(name, description), Saving { - constructor(name: String, x: Float, y: Float, scale: Float, toggleable: Boolean, description: String, module: Module, draw: (Boolean) -> Pair) - : this(name, HudElement(x, y, scale, toggleable, draw), toggleable, description, module) + constructor(name: String, x: Float, y: Float, scale: Float, default: Boolean, toggleable: Boolean, description: String, module: Module, draw: (Boolean) -> Pair) + : this(name, HudElement(x, y, scale, default, draw), toggleable, description, module) override val default: HudElement = hud override var value: HudElement = default diff --git a/src/main/kotlin/me/odinmain/clickgui/settings/impl/ListSetting.kt b/src/main/kotlin/me/odinmain/clickgui/settings/impl/ListSetting.kt index 7ff347719..b2dd84591 100644 --- a/src/main/kotlin/me/odinmain/clickgui/settings/impl/ListSetting.kt +++ b/src/main/kotlin/me/odinmain/clickgui/settings/impl/ListSetting.kt @@ -14,7 +14,8 @@ import java.lang.reflect.Type class ListSetting>( name: String, override val default: T, - private val type: Type + private val type: Type, + private val reloader: ((E) -> E)? = null ) : Setting(name, description = ""), Saving { override var value: T = default @@ -22,10 +23,10 @@ class ListSetting>( override fun write(): JsonElement = gson.toJsonTree(value) override fun read(element: JsonElement?) { - element?.asJsonArray?.let { - val temp = gson.fromJson(it, type) + element?.asJsonArray?.let { ja -> + val temp = gson.fromJson(ja, type) value.clear() - value.addAll(temp) + value.addAll(reloader?.let{ temp.map(it) } ?: temp) } } } @@ -33,4 +34,5 @@ class ListSetting>( inline fun > ListSetting( name: String, default: T, -): ListSetting = ListSetting(name, default, object : TypeToken() {}.type) \ No newline at end of file + noinline reloader: ((E) -> E)? = null +): ListSetting = ListSetting(name, default, object : TypeToken() {}.type, reloader) diff --git a/src/main/kotlin/me/odinmain/commands/CommandRegistry.kt b/src/main/kotlin/me/odinmain/commands/CommandRegistry.kt index 0ff2a4921..0793ca84f 100644 --- a/src/main/kotlin/me/odinmain/commands/CommandRegistry.kt +++ b/src/main/kotlin/me/odinmain/commands/CommandRegistry.kt @@ -20,7 +20,8 @@ object CommandRegistry { termSimCommand, chatCommandsCommand, devCommand, highlightCommand, waypointCommand, dungeonWaypointsCommand, - petCommand, visualWordsCommand, PosMsgCommand + petCommand, visualWordsCommand, PosMsgCommand, + CountdownsCommand ) fun add(vararg commands: Commodore) { diff --git a/src/main/kotlin/me/odinmain/commands/impl/CountdownsCommand.kt b/src/main/kotlin/me/odinmain/commands/impl/CountdownsCommand.kt new file mode 100644 index 000000000..43477d914 --- /dev/null +++ b/src/main/kotlin/me/odinmain/commands/impl/CountdownsCommand.kt @@ -0,0 +1,58 @@ +package me.odinmain.commands.impl + +import com.github.stivais.commodore.Commodore +import com.github.stivais.commodore.utils.GreedyString +import me.odinmain.config.Config +import me.odinmain.features.impl.skyblock.Countdowns.countdownTriggers +import me.odinmain.features.impl.skyblock.Countdowns.CountdownTrigger +import me.odinmain.utils.addOrNull +import me.odinmain.utils.skyblock.modMessage +import me.odinmain.utils.toFixed + +val CountdownsCommand = Commodore("countdowns") { + literal("add").runs { prefix: String, time: Int, message: GreedyString -> + val prefix = prefix.replace("&", "§") + countdownTriggers.addOrNull(CountdownTrigger(prefix.replace("&", "§"), time, false, message.string)) + ?: return@runs modMessage("This thing already exists!") + modMessage("$prefix${time.toFixed(divisor = 20)}, Triggers by \"$message\"") + Config.save() + } + + literal("addregex").runs { prefix: String, time: Int, message: GreedyString -> + val prefix = prefix.replace("&", "§") + runCatching { + Regex(message.string) + }.onSuccess { + countdownTriggers.addOrNull(CountdownTrigger(prefix, time, true, message.string)) + ?: return@runs modMessage("This thing already exists!") + modMessage("$prefix${time.toFixed(divisor = 20)}, Triggers by regex \"$message\"") + Config.save() + }.onFailure { + modMessage("Bad regex!") + } + } + + literal("remove").runs { index: Int -> + runCatching { + countdownTriggers.removeAt(index) + }.onSuccess { + modMessage("Removed Countdown Trigger #$index") + Config.save() + }.onFailure { + modMessage("Theres no countdown trigger in position #$index") + } + } + + literal("clear").runs { + countdownTriggers.clear() + modMessage("Cleared List") + Config.save() + } + + literal("list").runs { + val output = countdownTriggers.withIndex().joinToString("\n") { (i, it) -> + "$i: ${it.prefix}${it.time.toFixed(divisor = 20)}&r, ${if (it.regex) "regex" else "normal"} \"${it.message}\"" + } + modMessage(if (countdownTriggers.isEmpty()) "The list is empty!" else "Countdown Trigger list:\n$output") + } +} diff --git a/src/main/kotlin/me/odinmain/commands/impl/DevCommand.kt b/src/main/kotlin/me/odinmain/commands/impl/DevCommand.kt index 28cf61343..33dd932c2 100644 --- a/src/main/kotlin/me/odinmain/commands/impl/DevCommand.kt +++ b/src/main/kotlin/me/odinmain/commands/impl/DevCommand.kt @@ -155,8 +155,20 @@ val devCommand = Commodore("oddev") { """.trimIndent(), "") } - literal("party").runs { - modMessage("${PartyUtils.isInParty}, ${PartyUtils.partyLeader}, ${PartyUtils.partyMembers}") + literal("party"){ + runs { + modMessage("${PartyUtils.isInParty}, ${PartyUtils.partyLeader}, ${PartyUtils.partyMembers}") + } + + literal("forceInParty").runs { + PartyUtils.forceInParty = !PartyUtils.forceInParty + modMessage("forceInParty is now: $PartyUtils.forceInParty") + } + + literal("forceIsLeader").runs { + PartyUtils.forceIsLeader = !PartyUtils.forceIsLeader + modMessage("forceIsLeader is now: $PartyUtils.forceIsLeader") + } } literal("simulate").runs { str: GreedyString -> diff --git a/src/main/kotlin/me/odinmain/commands/impl/OdinCommand.kt b/src/main/kotlin/me/odinmain/commands/impl/OdinCommand.kt index 659457b24..12a2a15cb 100644 --- a/src/main/kotlin/me/odinmain/commands/impl/OdinCommand.kt +++ b/src/main/kotlin/me/odinmain/commands/impl/OdinCommand.kt @@ -70,6 +70,7 @@ val mainCommand = Commodore("od", "odin") { §3- /posmsg §7» §8Position message command. §3- /chatclist §7» §8Used to configure your blacklist/whitelist. §3- /highlight §7» §8Used to configure Highlight list. + §3- /countdowns §7» §8Make custom countdowns by chat triggers. §3- /waypoint §7» §8Configure waypoints. §3- /termsim ? §7» §8Simulates terminals so you can practice them. §3- /od rq §7» §8Requeues dungeon run. diff --git a/src/main/kotlin/me/odinmain/events/EventDispatcher.kt b/src/main/kotlin/me/odinmain/events/EventDispatcher.kt index f160bebd9..81fa10b66 100644 --- a/src/main/kotlin/me/odinmain/events/EventDispatcher.kt +++ b/src/main/kotlin/me/odinmain/events/EventDispatcher.kt @@ -48,7 +48,7 @@ object EventDispatcher { if (event.packet is S29PacketSoundEffect && inDungeons && !inBoss && (event.packet.soundName.equalsOneOf("mob.bat.hurt", "mob.bat.death") && event.packet.volume == 0.1f)) SecretPickupEvent.Bat(event.packet).postAndCatch() - if (event.packet is S02PacketChat && ChatPacketEvent(event.packet.chatComponent.unformattedText.noControlCodes).postAndCatch()) + if (event.packet is S02PacketChat && event.packet.type != 2.toByte() && ChatPacketEvent(event.packet.chatComponent.unformattedText.noControlCodes).postAndCatch()) event.isCanceled = true } diff --git a/src/main/kotlin/me/odinmain/features/Module.kt b/src/main/kotlin/me/odinmain/features/Module.kt index 01635f30e..7888e7d36 100644 --- a/src/main/kotlin/me/odinmain/features/Module.kt +++ b/src/main/kotlin/me/odinmain/features/Module.kt @@ -104,12 +104,13 @@ abstract class Module( fun HUD( name: String, desc: String, + default: Boolean = true, toggleable: Boolean = true, x: Float = 10f, y: Float = 10f, scale: Float = 2f, block: (example: Boolean) -> Pair - ): HUDSetting = HUDSetting(name, x, y, scale, toggleable, desc, this, block) + ): HUDSetting = HUDSetting(name, x, y, scale, default, toggleable, desc, this, block) /** * Helper function to make cleaner code, and better performance, since we don't need multiple registers for packet received events. diff --git a/src/main/kotlin/me/odinmain/features/ModuleManager.kt b/src/main/kotlin/me/odinmain/features/ModuleManager.kt index 0f219b489..e2585f47f 100644 --- a/src/main/kotlin/me/odinmain/features/ModuleManager.kt +++ b/src/main/kotlin/me/odinmain/features/ModuleManager.kt @@ -65,7 +65,7 @@ object ModuleManager { //skyblock NoCursorReset, AutoSprint, BlazeAttunement, ChatCommands, DeployableTimer, DianaHelper, ArrowHit, Ragnarock, MobSpawn, Splits, WardrobeKeybinds, InvincibilityTimer, ItemsHighlight, PlayerDisplay, - FarmKeys, PetKeybinds, CommandKeybinds, SpringBoots, AbilityTimers, SlotBinds, + FarmKeys, PetKeybinds, CommandKeybinds, SpringBoots, AbilityTimers, SlotBinds, Countdowns, // kuudra BuildHelper, FreshTools, KuudraDisplay, NoPre, PearlWaypoints, RemovePerks, SupplyHelper, TeamHighlight, diff --git a/src/main/kotlin/me/odinmain/features/impl/dungeon/MapInfo.kt b/src/main/kotlin/me/odinmain/features/impl/dungeon/MapInfo.kt index bc5f63c0b..3bf25b3bb 100644 --- a/src/main/kotlin/me/odinmain/features/impl/dungeon/MapInfo.kt +++ b/src/main/kotlin/me/odinmain/features/impl/dungeon/MapInfo.kt @@ -115,7 +115,8 @@ object MapInfo : Module( return when { score < 270 -> "§c${score}" score < 300 -> "§e${score}" - else -> "§a${score}" + score < 305 -> "§a${score}" + else -> "§b${score}" } } diff --git a/src/main/kotlin/me/odinmain/features/impl/dungeon/SpiritBear.kt b/src/main/kotlin/me/odinmain/features/impl/dungeon/SpiritBear.kt index 9610f4467..c27cc4baf 100644 --- a/src/main/kotlin/me/odinmain/features/impl/dungeon/SpiritBear.kt +++ b/src/main/kotlin/me/odinmain/features/impl/dungeon/SpiritBear.kt @@ -15,7 +15,7 @@ object SpiritBear : Module( name = "Spirit Bear", description = "Displays the current state of Spirit Bear." ) { - private val hud by HUD("Hud", "Displays the current state of Spirit Bear in the HUD.", false) { example -> + private val hud by HUD("Hud", "Displays the current state of Spirit Bear in the HUD.", toggleable = false) { example -> when { example -> "§e1.45s" !DungeonUtils.isFloor(4) || !DungeonUtils.inBoss -> null diff --git a/src/main/kotlin/me/odinmain/features/impl/skyblock/ChatCommands.kt b/src/main/kotlin/me/odinmain/features/impl/skyblock/ChatCommands.kt index 23305e410..a5049308f 100644 --- a/src/main/kotlin/me/odinmain/features/impl/skyblock/ChatCommands.kt +++ b/src/main/kotlin/me/odinmain/features/impl/skyblock/ChatCommands.kt @@ -5,11 +5,13 @@ import me.odinmain.clickgui.settings.impl.BooleanSetting import me.odinmain.clickgui.settings.impl.DropdownSetting import me.odinmain.clickgui.settings.impl.ListSetting import me.odinmain.events.impl.MessageSentEvent +import me.odinmain.events.impl.PacketEvent import me.odinmain.features.Module import me.odinmain.features.impl.dungeon.DungeonRequeue.disableRequeue import me.odinmain.utils.* import me.odinmain.utils.skyblock.* import net.minecraft.event.ClickEvent +import net.minecraft.network.play.client.C01PacketChatMessage import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.time.ZonedDateTime import java.time.format.DateTimeFormatter @@ -52,6 +54,10 @@ object ChatCommands : Module( private val location by BooleanSetting("Location", false, desc = "Sends your current location.").withDependency { showSettings } private val holding by BooleanSetting("Holding", false, desc = "Sends the item you are holding.").withDependency { showSettings } + private val showExtraStuff by DropdownSetting("Show Extra Stuff", false) + private val noMoreLocraw by BooleanSetting("No More Locraw", false, desc = "Cancel repetitive /locraw commands.").withDependency { showExtraStuff } + + private var locrawSent = false private val dtReason = mutableListOf>() val blacklist: MutableList by ListSetting("Blacklist", mutableListOf()) @@ -85,7 +91,10 @@ object ChatCommands : Module( runIn(5) { handleChatCommands(msg, ign, channel) } } - onWorldLoad { dtReason.clear() } + onWorldLoad { + locrawSent = false + dtReason.clear() + } } private fun handleChatCommands(message: String, name: String, channel: ChatChannel) { @@ -187,6 +196,18 @@ object ChatCommands : Module( sendChatMessage(words.joinToString(" ")) } + @SubscribeEvent + fun onPacket(event: PacketEvent.Send) { + (event.packet as? C01PacketChatMessage)?.let { + if (!noMoreLocraw || it.message != "/locraw") return + if (locrawSent) { + event.isCanceled = true + } else { + locrawSent = true + } + } + } + private val replacements = mapOf( "<3" to "❤", "o/" to "( ゚◡゚)/", diff --git a/src/main/kotlin/me/odinmain/features/impl/skyblock/Countdowns.kt b/src/main/kotlin/me/odinmain/features/impl/skyblock/Countdowns.kt new file mode 100644 index 000000000..9d59e5f84 --- /dev/null +++ b/src/main/kotlin/me/odinmain/features/impl/skyblock/Countdowns.kt @@ -0,0 +1,87 @@ +package me.odinmain.features.impl.skyblock + + +import me.odinmain.clickgui.settings.Setting.Companion.withDependency +import me.odinmain.clickgui.settings.impl.ActionSetting +import me.odinmain.clickgui.settings.impl.DropdownSetting +import me.odinmain.clickgui.settings.impl.ListSetting +import me.odinmain.events.impl.ServerTickEvent +import me.odinmain.features.Module +import me.odinmain.utils.addOrNull +import me.odinmain.utils.render.Colors +import me.odinmain.utils.toFixed +import me.odinmain.utils.ui.drawStringWidth +import me.odinmain.utils.ui.getMCTextHeight +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import java.util.concurrent.CopyOnWriteArrayList + +object Countdowns : Module( + name = "Countdowns", + description = "Starts a countdown in HUD when you trigger certain chat message, or regex expressions." +) { + private val hud by HUD("Hud", "Displays something i can't tell.", toggleable = false) { example -> + if (example) return@HUD drawStringWidth("Some Countdown: 3.50s", 1f, 1f, Colors.WHITE) to 10f + if (countdowns.isEmpty()) return@HUD 0f to 0f + + var w = 1f + var h = 1f + val lineHeight = getMCTextHeight() + + countdowns.forEach { + w = maxOf(w, drawStringWidth( + "§r${it.prefix}${it.time.toFixed(divisor = 20)}", + 1f, h, Colors.WHITE + )) + h += lineHeight + } + + w to h + } + + data class CountdownTrigger(val prefix: String, val time: Int, val regex: Boolean, val message: String) { + @Transient + var realRegex: Regex? = if (regex) { + runCatching { Regex(message) }.getOrNull() + } else { + null + } + } + val countdownTriggers by ListSetting("Countdowns", mutableListOf()) { it.copy() } + + private val presetsDropdown by DropdownSetting("Add Presets") + private val presetQuiz by ActionSetting("Quiz", desc = "Quiz puzzle in dungeons. (2)") { + countdownTriggers.addOrNull(CountdownTrigger("§eQuiz: §f", 220, false, "[STATUE] Oruo the Omniscient: I am Oruo the Omniscient. I have lived many lives. I have learned all there is to know.")) + countdownTriggers.addOrNull(CountdownTrigger("§eQuiz: §f", 140, true, "\\[STATUE\\] Oruo the Omniscient: \\w{1,16} answered Question #[12] correctly!")) + }.withDependency { presetsDropdown } + private val presetEndIsland by ActionSetting("End Island", desc = "Endstone & Dragon Protector spawn. (2)") { + countdownTriggers.addOrNull(CountdownTrigger("§eEndstone Protector: §f", 400, false, "The ground begins to shake as an Endstone Protector rises from below!")) + countdownTriggers.addOrNull(CountdownTrigger("§eDragon: §f", 174, true, "☬ \\w{1,16} placed a Summoning Eye! Brace yourselves! \\(8/8\\)")) + }.withDependency { presetsDropdown } + private val presetM3FireFreeze by ActionSetting("M3 Fire Freeze", desc = "The Professor. (1)") { + countdownTriggers.addOrNull(CountdownTrigger("§eFire Freeze: §f", 106, false, "[BOSS] The Professor: Oh? You found my Guardians' one weakness?")) + }.withDependency { presetsDropdown } + + private data class Countdown(val prefix: String, var time: Int) + private val countdowns = CopyOnWriteArrayList() + + init { + onMessage(Regex(".*")) { result -> + countdownTriggers.firstOrNull { + if (it.regex) (it.realRegex?.let { regex -> result.value.matches(regex) } ?: false) else (it.message == result.value) + }?.let { + countdowns.add(Countdown(it.prefix, it.time)) + } + } + + onWorldLoad { + countdowns.clear() + } + } + + @SubscribeEvent + fun onServerTick(event: ServerTickEvent) { + countdowns.removeIf { + --it.time <= 0 + } + } +} diff --git a/src/main/kotlin/me/odinmain/utils/ServerUtils.kt b/src/main/kotlin/me/odinmain/utils/ServerUtils.kt index d0a17b575..4138bb5b8 100644 --- a/src/main/kotlin/me/odinmain/utils/ServerUtils.kt +++ b/src/main/kotlin/me/odinmain/utils/ServerUtils.kt @@ -4,9 +4,10 @@ import me.odinmain.OdinMain.mc import me.odinmain.events.impl.PacketEvent import me.odinmain.utils.clock.Executor import me.odinmain.utils.clock.Executor.Companion.register -import me.odinmain.utils.skyblock.sendCommand -import net.minecraft.network.play.server.S02PacketChat +import me.odinmain.utils.skyblock.LocationUtils.isOnHypixel +import net.minecraft.network.play.client.C16PacketClientStatus import net.minecraft.network.play.server.S03PacketTimeUpdate +import net.minecraft.network.play.server.S37PacketStatistics import net.minecraftforge.event.world.WorldEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -17,28 +18,24 @@ object ServerUtils { var averagePing = 0f private set - private val unknownCommandRegex = Regex("^/?Unknown command\\. Type \"/?help\" for help\\. \\('odingetpingcommand-----'\\)$") private var pingStartTime = 0L private var isPinging = false private var prevTime = 0L init { Executor(2000, "ServerUtils") { - if (mc.isSingleplayer) return@Executor + if (!isOnHypixel) return@Executor pingStartTime = System.nanoTime() isPinging = true - - sendCommand("odingetpingcommand-----") + mc.netHandler?.addToSendQueue(C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS)) }.register() } @SubscribeEvent fun onPacket(event: PacketEvent.Receive) { when (event.packet) { - is S02PacketChat -> { - if (event.packet.chatComponent?.unformattedText?.noControlCodes?.let { unknownCommandRegex.matches(it) } == false) return + is S37PacketStatistics -> { averagePing = (System.nanoTime() - pingStartTime) / 1e6f - event.isCanceled = true isPinging = false } @@ -58,4 +55,4 @@ object ServerUtils { averageTps = 20f prevTime = 0L } -} \ No newline at end of file +} diff --git a/src/main/kotlin/me/odinmain/utils/Utils.kt b/src/main/kotlin/me/odinmain/utils/Utils.kt index ac96c372c..08707cd2d 100644 --- a/src/main/kotlin/me/odinmain/utils/Utils.kt +++ b/src/main/kotlin/me/odinmain/utils/Utils.kt @@ -58,6 +58,9 @@ fun String.containsOneOf(options: Collection, ignoreCase: Boolean = fals fun Number.toFixed(decimals: Int = 2): String = "%.${decimals}f".format(Locale.US, this) +fun Number.toFixed(decimals: Int = 2, divisor: Int): String = + "%.${decimals}f".format(Locale.US, this / divisor) + fun String.startsWithOneOf(vararg options: String, ignoreCase: Boolean = false): Boolean = options.any { this.startsWith(it, ignoreCase) } @@ -231,6 +234,15 @@ inline fun MutableCollection.removeFirstOrNull(predicate: (T) -> Boolean) return first } +fun MutableList.addOrNull(element: T): T? { + return if (element in this) { + null + } else { + this.add(element) + element + } +} + fun Int.addRange(add: Int): IntRange = this..this+add fun runOnMCThread(run: () -> Unit) { @@ -245,24 +257,23 @@ fun EntityLivingBase?.getSBMaxHealth(): Float { return this?.getEntityAttribute(SharedMonsterAttributes.maxHealth)?.baseValue?.toFloat() ?: 0f } -fun formatNumber(unFormatNumber: Any): String { - val number: Double = when (unFormatNumber) { - is String -> unFormatNumber.replace(",", "").toDoubleOrNull() ?: 0.0 - is Number -> unFormatNumber.toDouble() - else -> unFormatNumber.toString().toDoubleOrNull() ?: 0.0 - } +private val oneDecimalFormat = DecimalFormat("#.#") +fun Number.formatOneOrNoDecimal(): String { + return oneDecimalFormat.format(this) +} + +fun formatNumber(number: Number): String { + val number = number.toDouble() return when { - number.absoluteValue < 1000 -> number.formatOneOrNoDecimal() - number.absoluteValue >= 1_000_000_000 -> (number / 1_000_000_000).formatOneOrNoDecimal()+"B" - number.absoluteValue >= 1_000_000 -> (number / 1_000_000).formatOneOrNoDecimal()+"M" - number.absoluteValue >= 1000 -> (number / 1000).formatOneOrNoDecimal()+"K" - else -> number.toString() + number.absoluteValue >= 1_000_000_000_000 -> (number / 1_000_000_000_000).formatOneOrNoDecimal() + "T" + number.absoluteValue >= 1_000_000_000 -> (number / 1_000_000_000).formatOneOrNoDecimal() + "B" + number.absoluteValue >= 1_000_000 -> (number / 1_000_000).formatOneOrNoDecimal() + "M" + number.absoluteValue >= 1_000 -> (number / 1_000).formatOneOrNoDecimal() + "K" + else -> number.formatOneOrNoDecimal() } } -private val oneDecimalFormat = DecimalFormat("#.#") - -fun Double.formatOneOrNoDecimal(): String { - return oneDecimalFormat.format(this) -} \ No newline at end of file +fun formatNumber(number: String): String{ + return formatNumber(number.replace(",", "").replace(" ", "").toDoubleOrNull() ?: 0.0) +} diff --git a/src/main/kotlin/me/odinmain/utils/skyblock/PartyUtils.kt b/src/main/kotlin/me/odinmain/utils/skyblock/PartyUtils.kt index 5a950ed6e..ec7739daf 100644 --- a/src/main/kotlin/me/odinmain/utils/skyblock/PartyUtils.kt +++ b/src/main/kotlin/me/odinmain/utils/skyblock/PartyUtils.kt @@ -35,6 +35,9 @@ object PartyUtils { Regex("^You are not currently in a party.$") ) + var forceInParty = false + var forceIsLeader = false + private val members = mutableListOf() var partyLeader: String? = null @@ -44,6 +47,7 @@ object PartyUtils { var isInParty: Boolean = false private set + get() = (forceInParty || field) @SubscribeEvent fun onChatPacket(event: ChatPacketEvent) = with(event.message) { @@ -154,5 +158,5 @@ object PartyUtils { isInParty = false } - fun isLeader(): Boolean = partyLeader == mc.thePlayer.name -} \ No newline at end of file + fun isLeader(): Boolean = (forceIsLeader || partyLeader == mc.thePlayer.name) +} diff --git a/src/main/kotlin/me/odinmain/utils/skyblock/dungeon/DungeonListener.kt b/src/main/kotlin/me/odinmain/utils/skyblock/dungeon/DungeonListener.kt index fc2109326..3841ff1a7 100644 --- a/src/main/kotlin/me/odinmain/utils/skyblock/dungeon/DungeonListener.kt +++ b/src/main/kotlin/me/odinmain/utils/skyblock/dungeon/DungeonListener.kt @@ -119,7 +119,7 @@ object DungeonListener { "prince killed", "prince slain", "prince killed!", "prince dead", "prince dead!", "\$skytils-dungeon-score-prince\$", Mimic.princeMessage -> dungeonStats.princeKilled = true - "blaze done!", "blaze done", "blaze puzzle solved!" -> + "blaze done!", "blaze done", "blaze puzzle solved!", "blaze puzzle finished!", "blaze finished!" -> puzzles.find { it == Puzzle.BLAZE }.let { it?.status = PuzzleStatus.Completed } } }