From cd7da09b4b8c1a72c867b927f1aa7f9547077f3e Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 15 Jan 2023 16:50:42 +0100 Subject: Moved packages. --- .../CrimsonIsleReputationHelper.kt | 4 +- .../reputationhelper/dailyquest/CrimsonMiniBoss.kt | 3 - .../dailyquest/DailyMiniBossHelper.kt | 67 ---------------------- .../dailyquest/DailyQuestHelper.kt | 1 + .../dailyquest/miniboss/CrimsonMiniBoss.kt | 3 + .../dailyquest/miniboss/DailyMiniBossHelper.kt | 67 ++++++++++++++++++++++ .../dailyquest/quest/MiniBossQuest.kt | 2 +- 7 files changed, 74 insertions(+), 73 deletions(-) delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/CrimsonMiniBoss.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyMiniBossHelper.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/miniboss/CrimsonMiniBoss.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/miniboss/DailyMiniBossHelper.kt (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt index 66fef9c0a..a5bcc7c9d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt @@ -3,9 +3,9 @@ package at.hannibal2.skyhanni.features.nether.reputationhelper import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.HyPixelData import at.hannibal2.skyhanni.data.IslandType -import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.CrimsonMiniBoss -import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.DailyMiniBossHelper import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.DailyQuestHelper +import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.miniboss.CrimsonMiniBoss +import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.miniboss.DailyMiniBossHelper import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings import net.minecraftforge.client.event.RenderGameOverlayEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/CrimsonMiniBoss.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/CrimsonMiniBoss.kt deleted file mode 100644 index a9442d4fb..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/CrimsonMiniBoss.kt +++ /dev/null @@ -1,3 +0,0 @@ -package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest - -class CrimsonMiniBoss(val displayName: String) \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyMiniBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyMiniBossHelper.kt deleted file mode 100644 index fbad68508..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyMiniBossHelper.kt +++ /dev/null @@ -1,67 +0,0 @@ -package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest - -import at.hannibal2.skyhanni.data.HyPixelData -import at.hannibal2.skyhanni.data.IslandType -import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.features.nether.reputationhelper.CrimsonIsleReputationHelper -import at.hannibal2.skyhanni.utils.LorenzUtils -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import java.util.regex.Pattern - -class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHelper) { - - private val miniBossesDoneToday = mutableMapOf() - private val miniBossesPatterns = mutableMapOf() - - fun init() { - for (miniBoss in reputationHelper.miniBosses) { - miniBossesDoneToday[miniBoss] = false - val patterns = " *§r§6§l${miniBoss.displayName.uppercase()} DOWN!" - println("patterns: '$patterns'") - miniBossesPatterns[miniBoss] = Pattern.compile(patterns) - } - } - - @SubscribeEvent - fun onChat(event: LorenzChatEvent) { - if (!HyPixelData.skyBlock) return - if (LorenzUtils.skyBlockIsland != IslandType.CRIMSON_ISLE) return - - val message = event.message - for (entry in miniBossesPatterns) { - val pattern = entry.value - if (pattern.matcher(message).matches()) { - finished(entry.key) - } - //§r§6§BLADESOUL DOWN! - } - // §r§6§lMAGMA BOSS DOWN! - // §r§6§lMAGE OUTLAW DOWN! - } - - private fun finished(miniBoss: CrimsonMiniBoss) { - LorenzUtils.debug("Detected mini boss death: ${miniBoss.displayName}") - reputationHelper.questHelper.finishMiniBoss(miniBoss) - miniBossesDoneToday[miniBoss] = true - reputationHelper.update() - } - - fun render(display: MutableList) { - val done = miniBossesDoneToday.count { it.value } -// val sneaking = Minecraft.getMinecraft().thePlayer.isSneaking -// if (done != 5 || sneaking) { - if (done != 5) { - display.add("") - display.add("Daily Bosses ($done/5 killed)") - for (entry in miniBossesDoneToday) { - display.add(renderQuest(entry.key, entry.value)) - } - } - } - - private fun renderQuest(miniBoss: CrimsonMiniBoss, doneToday: Boolean): String { - val color = if (doneToday) "§7Done" else "§bTodo" - val displayName = miniBoss.displayName - return "$displayName: $color" - } -} \ No newline at end of file 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 3b36c83b6..a237f9546 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 @@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.ProfileApiDataLoadedEvent import at.hannibal2.skyhanni.features.nether.reputationhelper.CrimsonIsleReputationHelper +import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.miniboss.CrimsonMiniBoss import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest.* import at.hannibal2.skyhanni.utils.InventoryUtils.getInventoryName import at.hannibal2.skyhanni.utils.ItemUtils.getLore diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/miniboss/CrimsonMiniBoss.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/miniboss/CrimsonMiniBoss.kt new file mode 100644 index 000000000..d1d753af6 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/miniboss/CrimsonMiniBoss.kt @@ -0,0 +1,3 @@ +package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.miniboss + +class CrimsonMiniBoss(val displayName: String) \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/miniboss/DailyMiniBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/miniboss/DailyMiniBossHelper.kt new file mode 100644 index 000000000..7c128ebd7 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/miniboss/DailyMiniBossHelper.kt @@ -0,0 +1,67 @@ +package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.miniboss + +import at.hannibal2.skyhanni.data.HyPixelData +import at.hannibal2.skyhanni.data.IslandType +import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.features.nether.reputationhelper.CrimsonIsleReputationHelper +import at.hannibal2.skyhanni.utils.LorenzUtils +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import java.util.regex.Pattern + +class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHelper) { + + private val miniBossesDoneToday = mutableMapOf() + private val miniBossesPatterns = mutableMapOf() + + fun init() { + for (miniBoss in reputationHelper.miniBosses) { + miniBossesDoneToday[miniBoss] = false + val patterns = " *§r§6§l${miniBoss.displayName.uppercase()} DOWN!" + println("patterns: '$patterns'") + miniBossesPatterns[miniBoss] = Pattern.compile(patterns) + } + } + + @SubscribeEvent + fun onChat(event: LorenzChatEvent) { + if (!HyPixelData.skyBlock) return + if (LorenzUtils.skyBlockIsland != IslandType.CRIMSON_ISLE) return + + val message = event.message + for (entry in miniBossesPatterns) { + val pattern = entry.value + if (pattern.matcher(message).matches()) { + finished(entry.key) + } + //§r§6§BLADESOUL DOWN! + } + // §r§6§lMAGMA BOSS DOWN! + // §r§6§lMAGE OUTLAW DOWN! + } + + private fun finished(miniBoss: CrimsonMiniBoss) { + LorenzUtils.debug("Detected mini boss death: ${miniBoss.displayName}") + reputationHelper.questHelper.finishMiniBoss(miniBoss) + miniBossesDoneToday[miniBoss] = true + reputationHelper.update() + } + + fun render(display: MutableList) { + val done = miniBossesDoneToday.count { it.value } +// val sneaking = Minecraft.getMinecraft().thePlayer.isSneaking +// if (done != 5 || sneaking) { + if (done != 5) { + display.add("") + display.add("Daily Bosses ($done/5 killed)") + for (entry in miniBossesDoneToday) { + display.add(renderQuest(entry.key, entry.value)) + } + } + } + + private fun renderQuest(miniBoss: CrimsonMiniBoss, doneToday: Boolean): String { + val color = if (doneToday) "§7Done" else "§bTodo" + val displayName = miniBoss.displayName + return "$displayName: $color" + } +} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/MiniBossQuest.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/MiniBossQuest.kt index d09b28f95..eb18c1193 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/MiniBossQuest.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/MiniBossQuest.kt @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest -import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.CrimsonMiniBoss +import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.miniboss.CrimsonMiniBoss class MiniBossQuest(val miniBoss: CrimsonMiniBoss, state: QuestState, needAmount: Int) : ProgressQuest(QuestCategory.MINIBOSS, miniBoss.displayName, state, needAmount) \ No newline at end of file -- cgit