From 2bff4a6e0982b358b7c3a44dcde5d5ea21602327 Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Wed, 25 Dec 2024 15:53:32 -0500 Subject: [PATCH] refactor: remove old DungeonEvent --- .../events/impl/skyblock/DungeonEvent.kt | 29 ------------------- .../features/impl/dungeons/DungeonFeatures.kt | 4 +-- .../impl/dungeons/ScoreCalculation.kt | 1 - .../impl/dungeons/solvers/BoulderSolver.kt | 1 - .../skytilsmod/listeners/DungeonListener.kt | 4 --- 5 files changed, 2 insertions(+), 37 deletions(-) delete mode 100644 mod/src/main/kotlin/gg/skytils/skytilsmod/events/impl/skyblock/DungeonEvent.kt diff --git a/mod/src/main/kotlin/gg/skytils/skytilsmod/events/impl/skyblock/DungeonEvent.kt b/mod/src/main/kotlin/gg/skytils/skytilsmod/events/impl/skyblock/DungeonEvent.kt deleted file mode 100644 index a1f368723..000000000 --- a/mod/src/main/kotlin/gg/skytils/skytilsmod/events/impl/skyblock/DungeonEvent.kt +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Skytils - Hypixel Skyblock Quality of Life Mod - * Copyright (C) 2020-2023 Skytils - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package gg.skytils.skytilsmod.events.impl.skyblock - -import gg.skytils.skytilsmod.events.SkytilsEvent - -open class DungeonEvent : SkytilsEvent() { - open class PuzzleEvent(val puzzle: String) : DungeonEvent() { - class Discovered(puzzle: String) : PuzzleEvent(puzzle) - class Completed(puzzle: String) : PuzzleEvent(puzzle) - class Reset(puzzle: String): PuzzleEvent(puzzle) - } -} \ No newline at end of file diff --git a/mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/DungeonFeatures.kt b/mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/DungeonFeatures.kt index f92f88278..6b71fc822 100644 --- a/mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/DungeonFeatures.kt +++ b/mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/DungeonFeatures.kt @@ -39,12 +39,12 @@ import gg.skytils.event.register import gg.skytils.skytilsmod.Skytils import gg.skytils.skytilsmod.Skytils.mc import gg.skytils.skytilsmod.Skytils.prefix +import gg.skytils.skytilsmod._event.DungeonPuzzleResetEvent import gg.skytils.skytilsmod._event.MainThreadPacketReceiveEvent import gg.skytils.skytilsmod._event.PacketReceiveEvent import gg.skytils.skytilsmod._event.PacketSendEvent import gg.skytils.skytilsmod.core.GuiManager import gg.skytils.skytilsmod.core.structure.GuiElement -import gg.skytils.skytilsmod.events.impl.skyblock.DungeonEvent import gg.skytils.skytilsmod.features.impl.dungeons.catlas.handlers.DungeonInfo import gg.skytils.skytilsmod.features.impl.handlers.MayorInfo import gg.skytils.skytilsmod.listeners.DungeonListener @@ -342,7 +342,7 @@ object DungeonFeatures : EventSubscriber { } } - fun onPuzzleReset(event: DungeonEvent.PuzzleEvent.Reset) { + fun onPuzzleReset(event: DungeonPuzzleResetEvent) { if (!Utils.inDungeons) return if (event.puzzle == "Higher Or Lower") { blazes = 0 diff --git a/mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ScoreCalculation.kt b/mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ScoreCalculation.kt index 476304cf5..864c7ac16 100644 --- a/mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ScoreCalculation.kt +++ b/mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ScoreCalculation.kt @@ -25,7 +25,6 @@ import gg.skytils.skytilsmod.core.GuiManager import gg.skytils.skytilsmod.core.structure.GuiElement import gg.skytils.skytilsmod.core.tickTimer import gg.skytils.skytilsmod.events.impl.MainReceivePacketEvent -import gg.skytils.skytilsmod.events.impl.skyblock.DungeonEvent import gg.skytils.skytilsmod.features.impl.dungeons.DungeonFeatures.dungeonFloorNumber import gg.skytils.skytilsmod.features.impl.handlers.MayorInfo import gg.skytils.skytilsmod.listeners.DungeonListener diff --git a/mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/solvers/BoulderSolver.kt b/mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/solvers/BoulderSolver.kt index 559af33a3..df66c7219 100644 --- a/mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/solvers/BoulderSolver.kt +++ b/mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/solvers/BoulderSolver.kt @@ -29,7 +29,6 @@ import gg.skytils.skytilsmod.Skytils.mc import gg.skytils.skytilsmod.Skytils.successPrefix import gg.skytils.skytilsmod._event.DungeonPuzzleDiscoveredEvent import gg.skytils.skytilsmod.core.tickTimer -import gg.skytils.skytilsmod.events.impl.skyblock.DungeonEvent import gg.skytils.skytilsmod.listeners.DungeonListener import gg.skytils.skytilsmod.utils.RenderUtil import gg.skytils.skytilsmod.utils.SuperSecretSettings diff --git a/mod/src/main/kotlin/gg/skytils/skytilsmod/listeners/DungeonListener.kt b/mod/src/main/kotlin/gg/skytils/skytilsmod/listeners/DungeonListener.kt index 154a7e91f..d50c4ce22 100644 --- a/mod/src/main/kotlin/gg/skytils/skytilsmod/listeners/DungeonListener.kt +++ b/mod/src/main/kotlin/gg/skytils/skytilsmod/listeners/DungeonListener.kt @@ -40,7 +40,6 @@ import gg.skytils.skytilsmod._event.MainThreadPacketReceiveEvent import gg.skytils.skytilsmod.commands.impl.RepartyCommand import gg.skytils.skytilsmod.core.API import gg.skytils.skytilsmod.core.tickTimer -import gg.skytils.skytilsmod.events.impl.skyblock.DungeonEvent import gg.skytils.skytilsmod.features.impl.dungeons.DungeonFeatures import gg.skytils.skytilsmod.features.impl.dungeons.DungeonTimer import gg.skytils.skytilsmod.features.impl.dungeons.ScoreCalculation @@ -282,15 +281,12 @@ object DungeonListener : EventSubscriber { val resetPuzzles = localMissingPuzzles.filter { it in completedPuzzles } resetPuzzles.forEach { - DungeonEvent.PuzzleEvent.Reset(it).postAndCatch() postSync(DungeonPuzzleResetEvent(it)) } newPuzzles.forEach { - DungeonEvent.PuzzleEvent.Discovered(it).postAndCatch() postSync(DungeonPuzzleDiscoveredEvent(it)) } localCompletedPuzzles.forEach { - DungeonEvent.PuzzleEvent.Completed(it).postAndCatch() postSync(DungeonPuzzleCompletedEvent(it)) } missingPuzzles.clear()