diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-04-03 23:21:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-03 23:21:54 +0200 |
commit | 35abf8b907c11f534d72314c36d653f7f8e33b7a (patch) | |
tree | 618f4f772d8ad083aee0cf010bd0b914e1166eae /src | |
parent | 0f77ab2ce97a54785baf743d04acb11474b201fd (diff) | |
download | skyhanni-35abf8b907c11f534d72314c36d653f7f8e33b7a.tar.gz skyhanni-35abf8b907c11f534d72314c36d653f7f8e33b7a.tar.bz2 skyhanni-35abf8b907c11f534d72314c36d653f7f8e33b7a.zip |
Backend: code cleanup (#1348)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/nether/kuudra/KuudraAPI.kt (renamed from src/main/java/at/hannibal2/skyhanni/features/nether/KuudraAPI.kt) | 28 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/nether/kuudra/KuudraTier.kt | 14 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt | 4 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/KuudraQuest.kt | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/kuudra/DailyKuudraBossHelper.kt | 6 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt | 2 |
7 files changed, 31 insertions, 27 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index c706e6098..e749f688f 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -322,7 +322,6 @@ import at.hannibal2.skyhanni.features.misc.trevor.TrevorSolver import at.hannibal2.skyhanni.features.misc.trevor.TrevorTracker import at.hannibal2.skyhanni.features.misc.update.UpdateManager import at.hannibal2.skyhanni.features.misc.visualwords.ModifyVisualWords -import at.hannibal2.skyhanni.features.nether.KuudraAPI import at.hannibal2.skyhanni.features.nether.PabloHelper import at.hannibal2.skyhanni.features.nether.SulphurSkitterBox import at.hannibal2.skyhanni.features.nether.VolcanoExplosivityDisplay @@ -333,6 +332,7 @@ import at.hannibal2.skyhanni.features.nether.ashfang.AshfangGravityOrbs import at.hannibal2.skyhanni.features.nether.ashfang.AshfangHideDamageIndicator import at.hannibal2.skyhanni.features.nether.ashfang.AshfangHideParticles import at.hannibal2.skyhanni.features.nether.ashfang.AshfangNextResetCooldown +import at.hannibal2.skyhanni.features.nether.kuudra.KuudraAPI import at.hannibal2.skyhanni.features.nether.reputationhelper.CrimsonIsleReputationHelper import at.hannibal2.skyhanni.features.rift.RiftAPI import at.hannibal2.skyhanni.features.rift.area.colosseum.BlobbercystsHighlight diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/KuudraAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/kuudra/KuudraAPI.kt index 8bbaa35c9..7501cf2b6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/KuudraAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/kuudra/KuudraAPI.kt @@ -1,4 +1,4 @@ -package at.hannibal2.skyhanni.features.nether +package at.hannibal2.skyhanni.features.nether.kuudra import at.hannibal2.skyhanni.data.ScoreboardData import at.hannibal2.skyhanni.events.KuudraCompleteEvent @@ -6,8 +6,7 @@ import at.hannibal2.skyhanni.events.KuudraEnterEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent -import at.hannibal2.skyhanni.utils.LorenzVec -import at.hannibal2.skyhanni.utils.NEUInternalName +import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -30,13 +29,13 @@ object KuudraAPI { @SubscribeEvent fun onTick(event: LorenzTickEvent) { - if (kuudraTier == null) { - for (line in ScoreboardData.sidebarLinesFormatted) { - tierPattern.matchMatcher(line) { - val tier = group("tier").toInt() - kuudraTier = tier - KuudraEnterEvent(tier).postAndCatch() - } + if (!LorenzUtils.inSkyBlock) return + if (kuudraTier != null) return + for (line in ScoreboardData.sidebarLinesFormatted) { + tierPattern.matchMatcher(line) { + val tier = group("tier").toInt() + kuudraTier = tier + KuudraEnterEvent(tier).postAndCatch() } } } @@ -55,13 +54,4 @@ object KuudraAPI { } } - class KuudraTier( - val name: String, - val displayItem: NEUInternalName, - val location: LorenzVec?, - val tierNumber: Int, - var doneToday: Boolean = false, - ) { - fun getDisplayName() = "Tier $tierNumber ($name)" - } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/kuudra/KuudraTier.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/kuudra/KuudraTier.kt new file mode 100644 index 000000000..0c6e91e26 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/kuudra/KuudraTier.kt @@ -0,0 +1,14 @@ +package at.hannibal2.skyhanni.features.nether.kuudra + +import at.hannibal2.skyhanni.utils.LorenzVec +import at.hannibal2.skyhanni.utils.NEUInternalName + +class KuudraTier( + val name: String, + val displayItem: NEUInternalName, + val location: LorenzVec?, + val tierNumber: Int, + var doneToday: Boolean = false, +) { + fun getDisplayName() = "Tier $tierNumber ($name)" +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt index ae6850e78..30356b9c9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt @@ -10,7 +10,7 @@ import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.TabListUpdateEvent -import at.hannibal2.skyhanni.features.nether.KuudraAPI +import at.hannibal2.skyhanni.features.nether.kuudra.KuudraTier import at.hannibal2.skyhanni.features.nether.reputationhelper.CrimsonIsleReputationHelper import at.hannibal2.skyhanni.features.nether.reputationhelper.FactionType import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest.DojoQuest @@ -263,7 +263,7 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { } } - fun finishKuudra(kuudraTier: KuudraAPI.KuudraTier) { + fun finishKuudra(kuudraTier: KuudraTier) { val kuudraQuest = getQuest<KuudraQuest>() ?: return // TODO make inline method for this two lines if (kuudraQuest.kuudraTier == kuudraTier && kuudraQuest.state == QuestState.ACCEPTED) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/KuudraQuest.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/KuudraQuest.kt index aadb9f110..4671c5daf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/KuudraQuest.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/KuudraQuest.kt @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest -import at.hannibal2.skyhanni.features.nether.KuudraAPI.KuudraTier +import at.hannibal2.skyhanni.features.nether.kuudra.KuudraTier class KuudraQuest(val kuudraTier: KuudraTier, state: QuestState) : Quest( diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/kuudra/DailyKuudraBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/kuudra/DailyKuudraBossHelper.kt index 265f59471..8b6a05f38 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/kuudra/DailyKuudraBossHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/kuudra/DailyKuudraBossHelper.kt @@ -6,7 +6,7 @@ import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.jsonobjects.repo.CrimsonIsleReputationJson.ReputationQuest import at.hannibal2.skyhanni.events.KuudraCompleteEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent -import at.hannibal2.skyhanni.features.nether.KuudraAPI +import at.hannibal2.skyhanni.features.nether.kuudra.KuudraTier import at.hannibal2.skyhanni.features.nether.reputationhelper.CrimsonIsleReputationHelper import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled import at.hannibal2.skyhanni.utils.ChatUtils @@ -20,7 +20,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class DailyKuudraBossHelper(private val reputationHelper: CrimsonIsleReputationHelper) { - val kuudraTiers = mutableListOf<KuudraAPI.KuudraTier>() + val kuudraTiers = mutableListOf<KuudraTier>() private var kuudraLocation: LorenzVec? = null private var allKuudraDone = true @@ -93,7 +93,7 @@ class DailyKuudraBossHelper(private val reputationHelper: CrimsonIsleReputationH if (location != null) { kuudraLocation = location } - kuudraTiers.add(KuudraAPI.KuudraTier(displayName, displayItem, location, tier)) + kuudraTiers.add(KuudraTier(displayName, displayItem, location, tier)) tier++ } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index a9b72f72c..861530a58 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -8,7 +8,7 @@ import at.hannibal2.skyhanni.data.TitleManager import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.features.dungeon.DungeonAPI import at.hannibal2.skyhanni.features.misc.visualwords.ModifyVisualWords -import at.hannibal2.skyhanni.features.nether.KuudraAPI +import at.hannibal2.skyhanni.features.nether.kuudra.KuudraAPI import at.hannibal2.skyhanni.mixins.transformers.AccessorGuiEditSign import at.hannibal2.skyhanni.test.TestBingo import at.hannibal2.skyhanni.utils.ChatUtils.lastButtonClicked |