From c6928dbbe9945c60030171e086ade6b30acfe533 Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Tue, 28 Sep 2021 23:00:50 -0400 Subject: e --- src/main/kotlin/skytils/skytilsmod/Skytils.kt | 47 +++++++++++----------- .../features/impl/dungeons/ScoreCalculation.kt | 2 +- 2 files changed, 24 insertions(+), 25 deletions(-) (limited to 'src/main') diff --git a/src/main/kotlin/skytils/skytilsmod/Skytils.kt b/src/main/kotlin/skytils/skytilsmod/Skytils.kt index 0520e571..2d764491 100644 --- a/src/main/kotlin/skytils/skytilsmod/Skytils.kt +++ b/src/main/kotlin/skytils/skytilsmod/Skytils.kt @@ -248,36 +248,35 @@ class Skytils { val cch = ClientCommandHandler.instance - if (cch is AccessorCommandHandler) { - cch.registerCommand(SkytilsCommand) + if (cch !is AccessorCommandHandler) throw RuntimeException("Skytils was unable to mixin to the CommandHandler. Please report this on our Discord at discord.gg/skytils.") + cch.registerCommand(SkytilsCommand) - cch.registerCommand(CataCommand) - cch.registerCommand(CalcXPCommand) - cch.registerCommand(HollowWaypointCommand) - cch.registerCommand(SlayerCommand) + cch.registerCommand(CataCommand) + cch.registerCommand(CalcXPCommand) + cch.registerCommand(HollowWaypointCommand) + cch.registerCommand(SlayerCommand) - if (!cch.commands.containsKey("armorcolor")) { - cch.registerCommand(ArmorColorCommand) - } + if (!cch.commands.containsKey("armorcolor")) { + cch.registerCommand(ArmorColorCommand) + } - if (!cch.commands.containsKey("glintcustomize")) { - cch.registerCommand(GlintCustomizeCommand) - } + if (!cch.commands.containsKey("glintcustomize")) { + cch.registerCommand(GlintCustomizeCommand) + } - if (!cch.commands.containsKey("trackcooldown")) { - cch.registerCommand(TrackCooldownCommand) - } + if (!cch.commands.containsKey("trackcooldown")) { + cch.registerCommand(TrackCooldownCommand) + } - if (config.overrideReparty || !cch.commands.containsKey("reparty")) { - cch.commandSet.add(RepartyCommand) - cch.commandMap["reparty"] = RepartyCommand - } + if (config.overrideReparty || !cch.commands.containsKey("reparty")) { + cch.commandSet.add(RepartyCommand) + cch.commandMap["reparty"] = RepartyCommand + } - if (config.overrideReparty || !cch.commands.containsKey("rp")) { - cch.commandSet.add(RepartyCommand) - cch.commandMap["rp"] = RepartyCommand - } - } else throw RuntimeException("Skytils was unable to mixin to the CommandHandler. Please report this on our Discord at discord.gg/skytils.") + if (config.overrideReparty || !cch.commands.containsKey("rp")) { + cch.commandSet.add(RepartyCommand) + cch.commandMap["rp"] = RepartyCommand + } DataFetcher.preload() MayorInfo.fetchMayorData() diff --git a/src/main/kotlin/skytils/skytilsmod/features/impl/dungeons/ScoreCalculation.kt b/src/main/kotlin/skytils/skytilsmod/features/impl/dungeons/ScoreCalculation.kt index 583262c8..0e9318c4 100644 --- a/src/main/kotlin/skytils/skytilsmod/features/impl/dungeons/ScoreCalculation.kt +++ b/src/main/kotlin/skytils/skytilsmod/features/impl/dungeons/ScoreCalculation.kt @@ -219,7 +219,7 @@ object ScoreCalculation { val matcher = partyAssistSecretsPattern.matcher(unformatted) if (matcher.find()) { val name = matcher.group("name") - val secrets = matcher.group("secrets").toInt() + val secrets = matcher.group("secrets").toIntOrNull() ?: return if (!rooms.containsKey(name)) { rooms[name] = secrets } -- cgit