From f881d99d5594362e5561b6971d25fdd9b78d787e Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 10 Jul 2023 19:33:48 +0200 Subject: Small rift config changes --- .../skyhanni/features/bazaar/BazaarDataHolder.kt | 2 +- .../skyhanni/features/damageindicator/MobFinder.kt | 2 +- .../features/inventory/HideNotClickableItems.kt | 2 +- .../skyhanni/features/misc/CurrentPetDisplay.kt | 2 +- .../features/misc/NonGodPotEffectDisplay.kt | 2 +- .../features/misc/discordrpc/DiscordStatus.kt | 2 +- .../skyhanni/features/rift/CruxTalismanDisplay.kt | 127 -------------- .../skyhanni/features/rift/DanceRoomHelper.kt | 173 -------------------- .../skyhanni/features/rift/EnigmaSoulWaypoints.kt | 182 --------------------- .../skyhanni/features/rift/HighlightRiftGuide.kt | 63 ------- .../skyhanni/features/rift/KloonHacking.kt | 158 ------------------ .../skyhanni/features/rift/KloonTerminal.kt | 14 -- .../features/rift/LivingMetalSuitProgress.kt | 95 ----------- .../at/hannibal2/skyhanni/features/rift/RiftAPI.kt | 19 --- .../skyhanni/features/rift/RiftAgaricusCap.kt | 70 -------- .../hannibal2/skyhanni/features/rift/RiftLarva.kt | 51 ------ .../skyhanni/features/rift/RiftLavaMazeParkour.kt | 75 --------- .../skyhanni/features/rift/RiftOdonata.kt | 51 ------ .../hannibal2/skyhanni/features/rift/RiftTimer.kt | 4 +- .../features/rift/RiftUpsideDownParkour.kt | 76 --------- .../features/rift/ShowMotesNpcSellPrice.kt | 3 +- .../skyhanni/features/rift/ShyCruxWarnings.kt | 27 --- .../skyhanni/features/rift/TubulatorParkour.kt | 70 -------- .../skyhanni/features/rift/VoltHighlighter.kt | 119 -------------- .../skyhanni/features/rift/area/RiftLarva.kt | 51 ++++++ .../rift/area/dreadfarm/RiftAgaricusCap.kt | 70 ++++++++ .../rift/area/dreadfarm/VoltHighlighter.kt | 120 ++++++++++++++ .../area/livingcave/LivingMetalSuitProgress.kt | 95 +++++++++++ .../rift/area/mirrorverse/DanceRoomHelper.kt | 173 ++++++++++++++++++++ .../rift/area/mirrorverse/RiftLavaMazeParkour.kt | 75 +++++++++ .../rift/area/mirrorverse/RiftUpsideDownParkour.kt | 76 +++++++++ .../rift/area/mirrorverse/TubulatorParkour.kt | 70 ++++++++ .../features/rift/area/westvillage/KloonHacking.kt | 159 ++++++++++++++++++ .../rift/area/westvillage/KloonTerminal.kt | 14 ++ .../features/rift/area/wyldwoods/RiftOdonata.kt | 51 ++++++ .../rift/area/wyldwoods/ShyCruxWarnings.kt | 28 ++++ .../rift/everywhere/CruxTalismanDisplay.kt | 126 ++++++++++++++ .../rift/everywhere/EnigmaSoulWaypoints.kt | 181 ++++++++++++++++++++ .../features/rift/everywhere/HighlightRiftGuide.kt | 61 +++++++ .../skyhanni/features/rift/everywhere/RiftAPI.kt | 19 +++ 40 files changed, 1379 insertions(+), 1379 deletions(-) delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/CruxTalismanDisplay.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/DanceRoomHelper.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/EnigmaSoulWaypoints.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/HighlightRiftGuide.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/KloonHacking.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/KloonTerminal.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/LivingMetalSuitProgress.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/RiftAgaricusCap.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/RiftLarva.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/RiftLavaMazeParkour.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/RiftOdonata.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/RiftUpsideDownParkour.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/ShyCruxWarnings.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/TubulatorParkour.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/VoltHighlighter.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/RiftLarva.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftAgaricusCap.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/DanceRoomHelper.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftLavaMazeParkour.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftUpsideDownParkour.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/TubulatorParkour.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonTerminal.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/RiftOdonata.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/ShyCruxWarnings.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/HighlightRiftGuide.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftAPI.kt (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt index d359cebc1..4ee209670 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt @@ -1,7 +1,7 @@ package at.hannibal2.skyhanni.features.bazaar import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.features.rift.RiftAPI +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI import at.hannibal2.skyhanni.utils.APIUtil import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt index 6b1a4f41b..b8c20ddab 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.withAlpha import at.hannibal2.skyhanni.features.dungeon.DungeonData import at.hannibal2.skyhanni.features.dungeon.DungeonLividFinder -import at.hannibal2.skyhanni.features.rift.RiftAPI +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper import at.hannibal2.skyhanni.utils.EntityUtils.hasBossHealth import at.hannibal2.skyhanni.utils.EntityUtils.hasMaxHealth diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt index a90ba8a6f..f51b625e6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt @@ -8,7 +8,7 @@ import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.features.bazaar.BazaarApi import at.hannibal2.skyhanni.features.garden.composter.ComposterOverlay import at.hannibal2.skyhanni.features.garden.visitor.GardenVisitorFeatures -import at.hannibal2.skyhanni.features.rift.RiftAPI.motesNpcPrice +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI.motesNpcPrice import at.hannibal2.skyhanni.utils.* import at.hannibal2.skyhanni.utils.InventoryUtils.getInventoryName import at.hannibal2.skyhanni.utils.ItemUtils.cleanName diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt index d1b2ace7e..328a4aa37 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryOpenEvent import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.features.rift.RiftAPI +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.between diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt index f6540e469..29cbfb837 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt @@ -2,7 +2,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.* -import at.hannibal2.skyhanni.features.rift.RiftAPI +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI import at.hannibal2.skyhanni.test.command.CopyErrorCommand import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt index c77776d5d..39f61f74b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt @@ -8,7 +8,7 @@ import at.hannibal2.skyhanni.data.GardenCropMilestones.Companion.getCounter import at.hannibal2.skyhanni.data.GardenCropMilestones.Companion.getTierForCrops import at.hannibal2.skyhanni.data.GardenCropMilestones.Companion.progressToNextLevel import at.hannibal2.skyhanni.features.garden.GardenAPI.getCropType -import at.hannibal2.skyhanni.features.rift.RiftAPI +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.colorCodeToRarity diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/CruxTalismanDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/CruxTalismanDisplay.kt deleted file mode 100644 index 632129d11..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/CruxTalismanDisplay.kt +++ /dev/null @@ -1,127 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.ConfigLoadEvent -import at.hannibal2.skyhanni.events.GuiRenderEvent -import at.hannibal2.skyhanni.events.LorenzTickEvent -import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName -import at.hannibal2.skyhanni.utils.ItemUtils.getLore -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList -import at.hannibal2.skyhanni.utils.NumberUtil.roundToPrecision -import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems -import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher -import at.hannibal2.skyhanni.utils.StringUtils.removeColor -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -object CruxTalismanDisplay { - - private val config get() = SkyHanniMod.feature.rift.cruxTalisman - private val partialName = "CRUX_TALISMAN" - private var display = emptyList>() - private val displayLine = mutableListOf() - private val bonusesLine = mutableListOf() - private val progressPattern = - ".*(?§[0-9a-z][IV1-4-]+)\\s+(?§[0-9a-z]\\w+)§[0-9a-z]:\\s*(?§[0-9a-z](?:§[0-9a-z])?MAXED|(?:§[0-9a-z]\\d+§[0-9a-z]\\/§[0-9a-z]\\d+)).*".toPattern() - private var maxed = false - private var percentValue = 0.0 - - @SubscribeEvent - fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { - if (!isEnabled()) return - config.position.renderStringsAndItems( - display, - posLabel = "Crux Talisman Display" - ) - } - - private fun update() { - display = drawDisplay() - } - - private fun drawDisplay() = buildList { - var maxedKill = 0 - var percent = 0 - for (crux in displayLine) - if (crux.maxed) - maxedKill++ - if (maxedKill == 6) - maxed = true - - if (!config.compactWhenMaxed && maxed) maxed = false - - if (displayLine.isNotEmpty()) { - addAsSingletonList("§7Crux Talisman Progress: ${if (maxed) "§a§lMAXED!" else "§a$percentValue%"}") - if (!maxed) { - displayLine.forEach { - percent += if (config.compactWhenMaxed) { - if (!it.maxed) { - "(?\\d+)/\\d+".toRegex().find(it.progress.removeColor())?.groupValues?.get(1) - ?.toInt() ?: 0 - } else 100 - } else { - if (it.progress.contains("MAXED")) - 100 - else { - "(?\\d+)/\\d+".toRegex().find(it.progress.removeColor())?.groupValues?.get(1) - ?.toInt() ?: 0 - } - } - addAsSingletonList(" ${it.tier} ${it.name}: ${it.progress}") - } - } - } - percentValue = ((percent.toDouble() / 600) * 100).roundToPrecision(1) - if (bonusesLine.isNotEmpty() && config.showBonuses.get()) { - addAsSingletonList("§7Bonuses:") - bonusesLine.forEach { addAsSingletonList(" $it") } - } - } - - - @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - if (!isEnabled()) return - if (!event.isMod(40)) return - if (!InventoryUtils.getItemsInOwnInventory().any { it.getInternalName().startsWith(partialName) }) return - - displayLine.clear() - bonusesLine.clear() - maxed = false - var bonusFound = false - val inventoryStack = InventoryUtils.getItemsInOwnInventory() - for (stack in inventoryStack) { - line@ for (line in stack.getLore()) { - progressPattern.matchMatcher(line) { - val tier = group("tier").replace("-", "0") - val name = group("name") - val progress = group("progress") - val crux = Crux(name, tier, progress, progress.contains("MAXED")) - displayLine.add(crux) - } - if (line.startsWith("§7Total Bonuses")) { - bonusFound = true - continue@line - } - if (bonusFound) { - if (line.isEmpty()) { - bonusFound = false - continue@line - } - bonusesLine.add(line) - } - } - } - update() - } - - @SubscribeEvent - fun onConfigLoad(event: ConfigLoadEvent) { - LorenzUtils.onToggle(config.showBonuses) { update() } - } - - data class Crux(val name: String, val tier: String, val progress: String, val maxed: Boolean) - - fun isEnabled() = RiftAPI.inRift() && config.enabled && LorenzUtils.skyBlockArea != "Mirrorverse" -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/DanceRoomHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/DanceRoomHelper.kt deleted file mode 100644 index 53b31902b..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/DanceRoomHelper.kt +++ /dev/null @@ -1,173 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.* -import at.hannibal2.skyhanni.utils.LocationUtils.isPlayerInside -import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings -import at.hannibal2.skyhanni.utils.StringUtils.firstLetterUppercase -import at.hannibal2.skyhanni.utils.jsonobjects.DanceRoomInstructionsJson -import kotlinx.coroutines.* -import net.minecraft.client.entity.EntityOtherPlayerMP -import net.minecraft.network.play.server.S45PacketTitle -import net.minecraft.util.AxisAlignedBB -import net.minecraftforge.event.world.WorldEvent -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -object DanceRoomHelper { - - private var display = emptyList() - private val config get() = SkyHanniMod.feature.rift.mirrorVerse.danceRoomHelper - private var index = 0 - private var found = false - private val danceRoom = AxisAlignedBB(-260.0, 32.0, -110.0, -267.0, 40.0, -102.0) - private var inRoom = false - private var instructions = emptyList() - private var countdown: String? = null - - fun update() { - display = buildList { - if (instructions.isEmpty()) { - add("§cError fetching Dance Room Instructions!") - add("§cTry §e/shreloadlocalrepo §cor §e/shupdaterepo") - } - for ((lineIndex, line) in instructions.withIndex()) { - addLine(lineIndex, line)?.let { add(it) } - } - } - } - - private fun addLine(lineIndex: Int, line: String) = with(config.danceRoomFormatting) { - val size = instructions.size - val format = line.format() - - if (index < size && index == lineIndex) { - val countdown = countdown?.let { "${color.countdown.formatColor()}$it" } ?: "" - "${now.formatColor()} $format $countdown" - - } else if (index + 1 < size && index + 1 == lineIndex) { - "${next.formatColor()} $format" - - } else if (index + 2 < size && (index + 2..index + config.lineToShow).contains(lineIndex)) { - "${later.formatColor()} $format" - - } else null - } - - private fun String.formatColor() = replace("&", "§") - - private fun String.format() = - split(" ").joinToString(" ") { it.firstLetterUppercase().addColor().replace("&", "§") } - - private fun String.addColor() = when (this) { - "Move" -> config.danceRoomFormatting.color.move - "Stand" -> config.danceRoomFormatting.color.stand - "Sneak" -> config.danceRoomFormatting.color.sneak - "Jump" -> config.danceRoomFormatting.color.jump - "Punch" -> config.danceRoomFormatting.color.punch - else -> config.danceRoomFormatting.color.fallback - } + this - - @SubscribeEvent - fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { - if (!isEnabled()) return - if (!inRoom) return - config.position.renderStrings( - display, - config.extraSpace, - posLabel = "Dance Room Helper" - ) - } - - @SubscribeEvent - fun onWorldChange(event: WorldEvent.Load) { - inRoom = false - } - - @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - if (!isEnabled()) return - if (event.isMod(10)) { - inRoom = danceRoom.isPlayerInside() - } - if (inRoom) { - update() - } - } - - @SubscribeEvent - fun onSound(event: PlaySoundEvent) { - if (!isEnabled() || !inRoom) return - if ((event.soundName == "random.burp" && event.volume == 0.8f) || (event.soundName == "random.levelup" && event.pitch == 1.8412699f && event.volume == 1.0f)) { - index = 0 - found = false - countdown = null - update() - } - if (event.soundName == "note.bassattack" && event.pitch == 0.6984127f && event.volume == 1.0f && !found) { - found = true - start(2000) - update() - } - } - - @SubscribeEvent - fun onPacket(event: PacketEvent.ReceiveEvent) { - if (!isEnabled()) return - val packet = event.packet - if (packet !is S45PacketTitle) return // TODO add a title event - if (config.hideOriginalTitle && inRoom) event.isCanceled = true - } - - private fun startCountdown(seconds: Int, milliseconds: Int) { - if (seconds <= 0 && milliseconds <= 0) { - countdown = null - return - } - - val countdownString = "%01d:%03d".format(seconds, milliseconds) - countdown = countdownString - - CoroutineScope(Dispatchers.Default).launch { - delay(1) - var updatedSeconds = seconds - var updatedMilliseconds = milliseconds - 1 - if (updatedMilliseconds < 0) { - updatedSeconds -= 1 - updatedMilliseconds += 1000 - } - startCountdown(updatedSeconds, updatedMilliseconds) - } - } - - @SubscribeEvent - fun onCheckRender(event: CheckRenderEntityEvent<*>) { - if (RiftAPI.inRift() && config.hidePlayers) { - val entity = event.entity - if (entity is EntityOtherPlayerMP) { - if (inRoom) { - event.isCanceled = true - } - } - } - } - - @SubscribeEvent - fun onRepoReload(event: RepositoryReloadEvent) { - event.getConstant("DanceRoomInstructions")?.let { - instructions = it.instructions - } - } - - fun start(interval: Long): Job { - return CoroutineScope(Dispatchers.Default).launch { - while (NonCancellable.isActive && found) { - index++ - startCountdown(0, 500) - delay(interval) - } - } - } - - fun isEnabled() = RiftAPI.inRift() && config.enabled -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/EnigmaSoulWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/EnigmaSoulWaypoints.kt deleted file mode 100644 index a7d40580b..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/EnigmaSoulWaypoints.kt +++ /dev/null @@ -1,182 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.* -import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled -import at.hannibal2.skyhanni.utils.ItemUtils.getLore -import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer -import at.hannibal2.skyhanni.utils.LorenzColor -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzVec -import at.hannibal2.skyhanni.utils.NEUItems -import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText -import at.hannibal2.skyhanni.utils.RenderUtils.highlight -import at.hannibal2.skyhanni.utils.StringUtils.removeColor -import at.hannibal2.skyhanni.utils.jsonobjects.EnigmaSoulsJson -import io.github.moulberry.notenoughupdates.events.ReplaceItemEvent -import io.github.moulberry.notenoughupdates.events.SlotClickEvent -import io.github.moulberry.notenoughupdates.util.Utils -import net.minecraft.client.gui.inventory.GuiChest -import net.minecraft.client.player.inventory.ContainerLocalMenu -import net.minecraft.inventory.ContainerChest -import net.minecraftforge.client.event.RenderWorldLastEvent -import net.minecraftforge.fml.common.eventhandler.EventPriority -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -object EnigmaSoulWaypoints { - private val config get() = SkyHanniMod.feature.rift.enigmaSoulWaypoints - private var inInventory = false - private var soulLocations = mapOf() - private val trackedSouls = mutableListOf() - private val inventoryUnfound = mutableListOf() - private var adding = true - - private val item by lazy { - val neuItem = NEUItems.getItemStack("SKYBLOCK_ENIGMA_SOUL", true) - Utils.createItemStack( - neuItem.item, - "§5Toggle Missing", - "§7Click here to toggle", - "§7the waypoints for each", - "§7missing souls on this page" - ) - } - - @SubscribeEvent - fun replaceItem(event: ReplaceItemEvent) { - if (!isEnabled()) return - - if (inventoryUnfound.isEmpty()) return - if (event.inventory is ContainerLocalMenu && inInventory && event.slotNumber == 31) { - event.replaceWith(item) - } - } - - @SubscribeEvent - fun onInventoryOpen(event: InventoryOpenEvent) { - inInventory = false - if (!event.inventoryName.contains("Enigma Souls")) return - inInventory = true - - for (stack in event.inventoryItems.values) { - val split = stack.displayName.split("Enigma: ") - if (split.size == 2) { - if (stack.getLore().last() == "§8✖ Not completed yet!") { - inventoryUnfound.add(split.last()) - } - } - } - } - - @SubscribeEvent - fun onInventoryClose(event: InventoryCloseEvent) { - inInventory = false - inventoryUnfound.clear() - adding = true - } - - @SubscribeEvent(priority = EventPriority.HIGH) - fun onSlotClick(event: SlotClickEvent) { - if (!inInventory || !isEnabled()) return - - if (event.slotId == 31 && inventoryUnfound.isNotEmpty()) { - event.usePickblockInstead() - if (adding) { - trackedSouls.addAll(inventoryUnfound) - adding = false - } else { - trackedSouls.removeAll(inventoryUnfound) - adding = true - } - } - - if (event.slot.stack == null) return - val split = event.slot.stack.displayName.split("Enigma: ") - if (split.size == 2) { - event.usePickblockInstead() - if (soulLocations.contains(split.last())) { - if (!trackedSouls.contains(split.last())) { - LorenzUtils.chat("§5Tracking the ${split.last()} Enigma Soul!") - trackedSouls.add(split.last()) - } else { - trackedSouls.remove(split.last()) - LorenzUtils.chat("§5No longer tracking the ${split.last()} Enigma Soul!") - } - } - } - } - - @SubscribeEvent(priority = EventPriority.LOWEST) - fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { - if (!isEnabled() || !inInventory) return - - if (event.gui !is GuiChest) return - val guiChest = event.gui - val chest = guiChest.inventorySlots as ContainerChest - - for (slot in chest.inventorySlots) { - if (slot == null) continue - val stack = slot.stack ?: continue - - for (soul in trackedSouls) { - if (stack.displayName.removeColor().contains(soul)) { - slot highlight LorenzColor.DARK_PURPLE - } - } - } - if (!adding) { - chest.inventorySlots[31] highlight LorenzColor.DARK_PURPLE - } - } - - @SubscribeEvent - fun onRenderWorld(event: RenderWorldLastEvent) { - if (!isEnabled()) return - for (soul in trackedSouls) { - soulLocations[soul]?.let { - event.drawWaypointFilled(it, LorenzColor.DARK_PURPLE.toColor(), seeThroughBlocks = true, beacon = true) - event.drawDynamicText(it.add(0, 1, 0), "§5$soul Soul", 1.5) - } - } - } - - @SubscribeEvent - fun onRepoReload(event: RepositoryReloadEvent) { - val data = event.getConstant("EnigmaSouls") ?: return - val areas = data.areas ?: error("'areas' is null in EnigmaSouls!") - soulLocations = buildMap { - for ((area, locations) in areas) { - for (location in locations) { - this[location.name] = location.position - } - } - } - } - - @SubscribeEvent - fun onChat(event: LorenzChatEvent) { - if (!isEnabled()) return - val message = event.message.removeColor().trim() - if (message == "You have already found that Enigma Soul!" || message == "SOUL! You unlocked an Enigma Soul!") { - hideClosestSoul() - } - } - - private fun hideClosestSoul() { - var closestSoul = "" - var closestDistance = 8.0 - - for ((soul, location) in soulLocations) { - if (location.distanceToPlayer() < closestDistance) { - closestSoul = soul - closestDistance = location.distanceToPlayer() - } - } - if (closestSoul in trackedSouls) { - trackedSouls.remove(closestSoul) - LorenzUtils.chat("§5Found the $closestSoul Enigma Soul!") - } - } - - fun isEnabled() = RiftAPI.inRift() && config.enabled -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/HighlightRiftGuide.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/HighlightRiftGuide.kt deleted file mode 100644 index 4335077a5..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/HighlightRiftGuide.kt +++ /dev/null @@ -1,63 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.GuiContainerEvent -import at.hannibal2.skyhanni.events.InventoryCloseEvent -import at.hannibal2.skyhanni.events.InventoryOpenEvent -import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getLore -import at.hannibal2.skyhanni.utils.LorenzColor -import at.hannibal2.skyhanni.utils.RenderUtils.highlight -import net.minecraftforge.fml.common.eventhandler.EventPriority -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class HighlightRiftGuide { - private val config get() = SkyHanniMod.feature.rift - private var inInventory = false - private var highlightedItems = emptyList() - - @SubscribeEvent - fun onInventoryOpen(event: InventoryOpenEvent) { - inInventory = false - - if (!isEnabled()) return - - val inGuide = event.inventoryItems[40]?.getLore()?.let { - if (it.size == 1) { - it[0].startsWith("§7To Rift Guide") - } else false - } ?: false - if (!inGuide) return - - val highlightedItems = mutableListOf() - for ((slot, stack) in event.inventoryItems) { - val lore = stack.getLore() - if (lore.isNotEmpty()) { - if (lore.last() == "§8✖ Not completed yet!") { - highlightedItems.add(slot) - } - } - } - inInventory = true - this.highlightedItems = highlightedItems - } - - @SubscribeEvent - fun onInventoryClose(event: InventoryCloseEvent) { - inInventory = false - } - - @SubscribeEvent(priority = EventPriority.LOW) - fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { - if (!isEnabled()) return - if (!inInventory) return - - for (slot in InventoryUtils.getItemsInOpenChest()) { - if (slot.slotIndex in highlightedItems) { - slot highlight LorenzColor.YELLOW - } - } - } - - fun isEnabled() = RiftAPI.inRift() && config.highlightGuide -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/KloonHacking.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/KloonHacking.kt deleted file mode 100644 index 3e6bc1dac..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/KloonHacking.kt +++ /dev/null @@ -1,158 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.data.ProfileStorageData -import at.hannibal2.skyhanni.events.* -import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled -import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName -import at.hannibal2.skyhanni.utils.ItemUtils.getLore -import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer -import at.hannibal2.skyhanni.utils.LorenzColor -import at.hannibal2.skyhanni.utils.RenderUtils.highlight -import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher -import at.hannibal2.skyhanni.utils.StringUtils.removeColor -import io.github.moulberry.notenoughupdates.events.SlotClickEvent -import net.minecraftforge.client.event.RenderWorldLastEvent -import net.minecraftforge.fml.common.eventhandler.EventPriority -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class KloonHacking { - private var wearingHelmet = false - private var inTerminalInventory = false - private var inColourInventory = false - private val correctButtons = mutableListOf() - private var nearestTerminal: KloonTerminal? = null - - @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - if (!RiftAPI.inRift()) return - if (event.isMod(20)) { - checkHelmet() - } - } - - private fun checkHelmet() { - wearingHelmet = InventoryUtils.getArmor()[3]?.getInternalName() == "RETRO_ENCABULATING_VISOR" - } - - @SubscribeEvent - fun onInventoryOpen(event: InventoryOpenEvent) { - inTerminalInventory = false - inColourInventory = false - nearestTerminal = null - if (!RiftAPI.inRift()) return - if (!SkyHanniMod.feature.rift.hacking.solver) return - if (event.inventoryName == "Hacking" || event.inventoryName == "Hacking (As seen on CSI)") { - inTerminalInventory = true - correctButtons.clear() - for ((slot, stack) in event.inventoryItems) { - if (slot in 2..6) { - correctButtons.add(stack.displayName.removeColor()) - } - } - } - if (event.inventoryName == "Hacked Terminal Color Picker") { - inColourInventory = true - } - } - - @SubscribeEvent - fun onInventoryClose(event: InventoryCloseEvent) { - inTerminalInventory = false - inColourInventory = false - } - - @SubscribeEvent - fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { - if (!RiftAPI.inRift()) return - if (inTerminalInventory) { - if (!SkyHanniMod.feature.rift.hacking.solver) return - var i = 0 - for (slot in InventoryUtils.getItemsInOpenChest()) { - if (slot.slotIndex == 11 + 10 * i) { - val correctButton = slot.stack!!.displayName.removeColor() == correctButtons[i] - slot highlight if (correctButton) LorenzColor.GREEN else LorenzColor.RED - continue - } - if (slot.slotIndex > i * 9 + 8 && slot.slotIndex < i * 9 + 18) { - if (slot.stack!!.displayName.removeColor() == correctButtons[i]) { - slot highlight LorenzColor.YELLOW - } - } - if (slot.slotIndex == i * 9 + 17) { - i += 1 - } - } - } - if (inColourInventory) { - if (!SkyHanniMod.feature.rift.hacking.colour) return - val targetColour = nearestTerminal ?: getNearestTerminal() - for (slot in InventoryUtils.getItemsInOpenChest()) { - if (slot.stack.getLore().any { it.contains(targetColour?.name ?: "") }) { - slot highlight LorenzColor.GREEN - } - } - } - } - - @SubscribeEvent(priority = EventPriority.HIGH) - fun onSlotClick(event: SlotClickEvent) { - if (!inTerminalInventory || !RiftAPI.inRift()) return - event.usePickblockInstead() - } - - @SubscribeEvent - fun onRenderWorld(event: RenderWorldLastEvent) { - if (!RiftAPI.inRift()) return - if (!SkyHanniMod.feature.rift.hacking.waypoints) return - if (!wearingHelmet) return - val hidden = ProfileStorageData.profileSpecific?.rift ?: return - for (terminal in KloonTerminal.values()) { - if (terminal !in hidden.completedKloonTerminals) { - event.drawWaypointFilled(terminal.location, LorenzColor.DARK_RED.toColor(), true, true) - } - } - } - - @SubscribeEvent - fun onChat(event: LorenzChatEvent) { - if (!RiftAPI.inRift()) return - if (!wearingHelmet) return - - "You've set the color of this terminal to (?.*)!".toPattern().matchMatcher(event.message.removeColor()) { - val hidden = ProfileStorageData.profileSpecific?.rift ?: return - val colour = group("colour") - val completedTerminal = KloonTerminal.values().firstOrNull { it.name == colour } ?: return - if (completedTerminal != nearestTerminal) return - hidden.completedKloonTerminals.add(completedTerminal) - } - } - - @SubscribeEvent - fun onTooltip(event: LorenzToolTipEvent) { - if (!RiftAPI.inRift()) return - if (!inTerminalInventory) return - if (!SkyHanniMod.feature.rift.hacking.solver) return - - val neededTooltips = listOf(0, 2, 3, 4, 5, 6, 8, 9, 26, 27, 44, 45) - if (event.slot.slotIndex !in neededTooltips) { - event.toolTip.clear() - } - } - - private fun getNearestTerminal(): KloonTerminal? { - var closestTerminal: KloonTerminal? = null - var closestDistance = 8.0 - - for (terminal in KloonTerminal.values()) { - val distance = terminal.location.distanceToPlayer() - if (distance < closestDistance) { - closestTerminal = terminal - closestDistance = distance - } - } - nearestTerminal = closestTerminal - return closestTerminal - } -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/KloonTerminal.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/KloonTerminal.kt deleted file mode 100644 index 320105f23..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/KloonTerminal.kt +++ /dev/null @@ -1,14 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.utils.LorenzVec - -enum class KloonTerminal(val location: LorenzVec) { - RED(LorenzVec(-69.0, 65.0, -63.0)), - ORANGE(LorenzVec(-44.0, 71.0, -62.0)), - YELLOW(LorenzVec(-39.0, 71.0, -95.0)), - GREEN(LorenzVec(-62.0, 71.0, -83.0)), - AQUA(LorenzVec(-33.0, 70.0, -134.5)), - BLUE(LorenzVec(-66.5, 72.0, -119.0)), - PURPLE(LorenzVec(-89.0, 73.0, -115.0)), - PINK(LorenzVec(-110.0, 73.0, -107.0)) -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/LivingMetalSuitProgress.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/LivingMetalSuitProgress.kt deleted file mode 100644 index b6758a923..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/LivingMetalSuitProgress.kt +++ /dev/null @@ -1,95 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.GuiRenderEvent -import at.hannibal2.skyhanni.events.LorenzTickEvent -import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList -import at.hannibal2.skyhanni.utils.NumberUtil.roundToPrecision -import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems -import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getLivingMetalProgress -import net.minecraft.item.ItemStack -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class LivingMetalSuitProgress { - - private val config get() = SkyHanniMod.feature.rift.livingMetalSuitProgress - private var display = emptyList>() - private var progressMap = mapOf() - - @SubscribeEvent - fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { - if (!isEnabled()) return - config.position.renderStringsAndItems( - display, - posLabel = "Living Metal Armor Progress" - ) - } - - private fun update() { - display = drawDisplay() - } - - fun drawDisplay(): List> = buildList { - val piecesMaxed = progressMap.values.filterNotNull().count { it >= 1 } - val isMaxed = piecesMaxed == 4 - - if (progressMap.isEmpty()) return@buildList - - val totalProgress = progressMap.values.map { it ?: 1.0 }.average().roundToPrecision(1) - val formatPercentage = LorenzUtils.formatPercentage(totalProgress) - addAsSingletonList("§7Living Metal Suit Progress: ${if (isMaxed) "§a§lMAXED!" else "§a$formatPercentage"}") - - if (config.compactWhenMaxed && isMaxed) return@buildList - - for ((stack, progress) in progressMap.entries.reversed()) { - add(buildList { - add(" §7- ") - add(stack) - add("${stack.displayName}: ") - add(progress?.let { - drawProgressBar(progress) + " §b${LorenzUtils.formatPercentage(progress)}" - } ?: "§cStart upgrading it!") - }) - } - } - - @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - if (!isEnabled()) return - if (!event.isMod(20)) return - val old = progressMap - progressMap = buildMap { - for (armor in InventoryUtils.getArmor().filterNotNull()) { - put(armor, armor.getLivingMetalProgress()?.toDouble()?.let { - it.coerceAtMost(100.0) / 100 - }) - } - } - if (old != progressMap) { - update() - } - } - - private fun drawProgressBar(percentage: Double): String { - val progressBarLength = 20 - val filledLength = (percentage * progressBarLength).toInt() - - val green = "§a" - val grey = "§7" - val reset = "§f" - - val progressBar = StringBuilder() - progressBar.append(green) - repeat(filledLength) { progressBar.append("|") } - - progressBar.append(grey) - repeat(progressBarLength - filledLength) { progressBar.append("|") } - - progressBar.append(reset) - return progressBar.toString() - } - - fun isEnabled() = RiftAPI.inRift() && config.enabled -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt deleted file mode 100644 index e0ff66926..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt +++ /dev/null @@ -1,19 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.config.features.RiftConfig -import at.hannibal2.skyhanni.data.IslandType -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName -import at.hannibal2.skyhanni.utils.LorenzUtils -import net.minecraft.item.ItemStack - -object RiftAPI { - fun inRift() = LorenzUtils.inIsland(IslandType.THE_RIFT) - - val config: RiftConfig get() = SkyHanniMod.feature.rift - - // internal name -> motes - var motesPrice = emptyMap() - - fun ItemStack.motesNpcPrice() = motesPrice[getInternalName()] -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAgaricusCap.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAgaricusCap.kt deleted file mode 100644 index c4b452396..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAgaricusCap.kt +++ /dev/null @@ -1,70 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.LorenzTickEvent -import at.hannibal2.skyhanni.utils.* -import at.hannibal2.skyhanni.utils.BlockUtils.getBlockStateAt -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName -import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText -import net.minecraftforge.client.event.RenderWorldLastEvent -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class RiftAgaricusCap { - private val config get() = SkyHanniMod.feature.rift - private var startTime = 0L - private var location: LorenzVec? = null - - @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - if (!isEnabled()) return - val area = LorenzUtils.skyBlockArea - if (area != "West Village" && area != "Dreadfarm") return - - location = updateLocation() - } - - private fun updateLocation(): LorenzVec? { - if (InventoryUtils.getItemInHand()?.getInternalName() != "FARMING_WAND") return null - val currentLocation = BlockUtils.getBlockLookingAt() ?: return null - - when (currentLocation.getBlockStateAt().toString()) { - "minecraft:brown_mushroom" -> { - return if (location != currentLocation) { - startTime = System.currentTimeMillis() - currentLocation - } else { - if (startTime == -1L) { - startTime = System.currentTimeMillis() - } - location - } - } - - "minecraft:red_mushroom" -> { - if (location == currentLocation) { - startTime = -1L - return location - } - } - } - return null - } - - @SubscribeEvent - fun onRenderWorld(event: RenderWorldLastEvent) { - if (!isEnabled()) return - - val location = location?.add(0.0, 0.6, 0.0) ?: return - - if (startTime == -1L) { - event.drawDynamicText(location, "§cClick!", 1.5) - return - } - - val countDown = System.currentTimeMillis() - startTime - val format = TimeUtils.formatDuration(countDown - 1000, showMilliSeconds = true) - event.drawDynamicText(location, "§b$format", 1.5) - } - - fun isEnabled() = RiftAPI.inRift() && config.agaricusCap -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftLarva.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftLarva.kt deleted file mode 100644 index 93df913c8..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftLarva.kt +++ /dev/null @@ -1,51 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.LorenzTickEvent -import at.hannibal2.skyhanni.events.withAlpha -import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper -import at.hannibal2.skyhanni.utils.EntityUtils.hasSkullTexture -import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName -import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor -import net.minecraft.client.Minecraft -import net.minecraft.entity.item.EntityArmorStand -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class RiftLarva { - private val config get() = SkyHanniMod.feature.rift.larvas - private var hasHookInHand = false - val larvaSkullTexture = - "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTgzYjMwZTlkMTM1YjA1MTkwZWVhMmMzYWM2MWUyYWI1NWEyZDgxZTFhNThkYmIyNjk4M2ExNDA4MjY2NCJ9fX0=" - - @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - if (!isEnabled()) return - - checkHand() - if (!hasHookInHand) return - - if (event.isMod(20)) { - findLarvas() - } - } - - private fun checkHand() { - hasHookInHand = InventoryUtils.getItemInHand()?.getInternalName() == "LARVA_HOOK" - } - - private fun findLarvas() { - - val list = Minecraft.getMinecraft().theWorld?.loadedEntityList ?: return - for (stand in list.filterIsInstance()) { - if (stand.hasSkullTexture(larvaSkullTexture)) { - RenderLivingEntityHelper.setEntityColor( - stand, - config.highlightColor.toChromaColor().withAlpha(1) - ) { isEnabled() && hasHookInHand } - } - } - } - - fun isEnabled() = RiftAPI.inRift() && config.highlight -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftLavaMazeParkour.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftLavaMazeParkour.kt deleted file mode 100644 index 20029f9b7..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftLavaMazeParkour.kt +++ /dev/null @@ -1,75 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.CheckRenderEntityEvent -import at.hannibal2.skyhanni.events.ConfigLoadEvent -import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.events.RepositoryReloadEvent -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor -import at.hannibal2.skyhanni.utils.ParkourHelper -import at.hannibal2.skyhanni.utils.jsonobjects.ParkourJson -import net.minecraftforge.client.event.RenderWorldLastEvent -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class RiftLavaMazeParkour { - private val config get() = SkyHanniMod.feature.rift.mirrorVerse.lavaMazeConfig - private var parkourHelper: ParkourHelper? = null - - @SubscribeEvent - fun onRepoReload(event: RepositoryReloadEvent) { - val data = event.getConstant("RiftLavaMazeParkour") ?: return - parkourHelper = ParkourHelper( - data.locations, - data.shortCuts, - platformSize = 1.0, - detectionRange = 1.0 - ) - updateConfig() - } - - @SubscribeEvent - fun onCheckRender(event: CheckRenderEntityEvent<*>) { - if (!isEnabled()) return - if (!config.hidePlayers) return - - parkourHelper?.let { - if (it.inParkour()) { - event.isCanceled = true - } - } - } - - @SubscribeEvent - fun onChatMessage(event: LorenzChatEvent) { - if (!isEnabled()) return - - if (event.message == "§c§lEEK! THE LAVA OOFED YOU!") { - parkourHelper?.reset() - } - } - - @SubscribeEvent - fun onConfigLoad(event: ConfigLoadEvent) { - LorenzUtils.onToggle(config.rainbowColor, config.monochromeColor, config.lookAhead) { - updateConfig() - } - } - - private fun updateConfig() { - parkourHelper?.run { - rainbowColor = config.rainbowColor.get() - monochromeColor = config.monochromeColor.get().toChromaColor() - lookAhead = config.lookAhead.get() + 1 - } - } - - @SubscribeEvent - fun onRenderWorld(event: RenderWorldLastEvent) { - if (!isEnabled()) return - - parkourHelper?.render(event) - } - - fun isEnabled() = RiftAPI.inRift() && LorenzUtils.skyBlockArea == "Mirrorverse" && config.enabled -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftOdonata.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftOdonata.kt deleted file mode 100644 index 7c3fae78b..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftOdonata.kt +++ /dev/null @@ -1,51 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.LorenzTickEvent -import at.hannibal2.skyhanni.events.withAlpha -import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper -import at.hannibal2.skyhanni.utils.EntityUtils.hasSkullTexture -import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName -import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor -import net.minecraft.client.Minecraft -import net.minecraft.entity.item.EntityArmorStand -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class RiftOdonata { - private val config get() = SkyHanniMod.feature.rift.odonata - private var hasBottleInHand = false - val odonataSkullTexture = - "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWZkODA2ZGVmZGZkZjU5YjFmMjYwOWM4ZWUzNjQ2NjZkZTY2MTI3YTYyMzQxNWI1NDMwYzkzNThjNjAxZWY3YyJ9fX0=" - - @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - if (!isEnabled()) return - - checkHand() - if (!hasBottleInHand) return - - if (event.isMod(20)) { - findOdonatas() - } - } - - private fun checkHand() { - hasBottleInHand = InventoryUtils.getItemInHand()?.getInternalName() == "EMPTY_ODONATA_BOTTLE" - } - - private fun findOdonatas() { - - val list = Minecraft.getMinecraft().theWorld?.loadedEntityList ?: return - for (stand in list.filterIsInstance()) { - if (stand.hasSkullTexture(odonataSkullTexture)) { - RenderLivingEntityHelper.setEntityColor( - stand, - config.highlightColor.toChromaColor().withAlpha(1) - ) { isEnabled() && hasBottleInHand } - } - } - } - - fun isEnabled() = RiftAPI.inRift() && config.highlight -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftTimer.kt index 42188244e..29919e940 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftTimer.kt @@ -1,8 +1,8 @@ package at.hannibal2.skyhanni.features.rift -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzActionBarEvent +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher @@ -11,7 +11,7 @@ import net.minecraftforge.event.world.WorldEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class RiftTimer { - private val config get() = SkyHanniMod.feature.rift.timer + private val config get() = RiftAPI.config.timer private var display = emptyList() private var maxTime = 0L private var latestTime = 0L diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftUpsideDownParkour.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftUpsideDownParkour.kt deleted file mode 100644 index 12f419a3a..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftUpsideDownParkour.kt +++ /dev/null @@ -1,76 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.CheckRenderEntityEvent -import at.hannibal2.skyhanni.events.ConfigLoadEvent -import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.events.RepositoryReloadEvent -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor -import at.hannibal2.skyhanni.utils.ParkourHelper -import at.hannibal2.skyhanni.utils.jsonobjects.ParkourJson -import net.minecraftforge.client.event.RenderWorldLastEvent -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class RiftUpsideDownParkour { - private val config get() = SkyHanniMod.feature.rift.mirrorVerse.upsideDownParkour - private var parkourHelper: ParkourHelper? = null - - @SubscribeEvent - fun onRepoReload(event: RepositoryReloadEvent) { - val data = event.getConstant("RiftUpsideDownParkour") ?: return - parkourHelper = ParkourHelper( - data.locations.map { it.add(-1.0, -1.0, -1.0) },// TODO remove offset. change repo instead - data.shortCuts, - platformSize = 2.0, - detectionRange = 2.0 - ) - updateConfig() - } - - @SubscribeEvent - fun onCheckRender(event: CheckRenderEntityEvent<*>) { - if (!isEnabled()) return - if (!config.hidePlayers) return - - parkourHelper?.let { - if (it.inParkour()) { - event.isCanceled = true - } - } - } - - @SubscribeEvent - fun onChatMessage(event: LorenzChatEvent) { - if (!isEnabled()) return - - if (event.message == "§c§lOH NO! THE LAVA OOFED YOU BACK TO THE START!") { - parkourHelper?.reset() - } - } - - @SubscribeEvent - fun onConfigLoad(event: ConfigLoadEvent) { - LorenzUtils.onToggle(config.rainbowColor, config.monochromeColor, config.lookAhead) { - updateConfig() - } - } - - private fun updateConfig() { - parkourHelper?.run { - rainbowColor = config.rainbowColor.get() - monochromeColor = config.monochromeColor.get().toChromaColor() - lookAhead = config.lookAhead.get() + 1 - outline = config.outline - } - } - - @SubscribeEvent - fun onRenderWorld(event: RenderWorldLastEvent) { - if (!isEnabled()) return - - parkourHelper?.render(event) - } - - fun isEnabled() = RiftAPI.inRift() && LorenzUtils.skyBlockArea == "Mirrorverse" && config.enabled -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/ShowMotesNpcSellPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/ShowMotesNpcSellPrice.kt index 41fb1f0b5..404e1f3e2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/ShowMotesNpcSellPrice.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/ShowMotesNpcSellPrice.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.rift -import at.hannibal2.skyhanni.features.rift.RiftAPI.motesNpcPrice +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI.motesNpcPrice import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import net.minecraftforge.event.entity.player.ItemTooltipEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/ShyCruxWarnings.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/ShyCruxWarnings.kt deleted file mode 100644 index a8b46741e..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/ShyCruxWarnings.kt +++ /dev/null @@ -1,27 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.data.TitleUtils -import at.hannibal2.skyhanni.events.LorenzTickEvent -import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer -import net.minecraft.client.Minecraft -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class ShyCruxWarnings { - private val shyNames = arrayOf("I'm ugly! :(", "Eek!", "Don't look at me!", "Look away!") - - @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - if (!RiftAPI.inRift() || !SkyHanniMod.feature.rift.crux.shyWarning) return - if (event.isMod(2)) { - checkForShy() - } - } - - private fun checkForShy() { - val list = Minecraft.getMinecraft().theWorld?.getLoadedEntityList() ?: return - if (list.any { it.name in shyNames && it.distanceToPlayer() < 8 }) { - TitleUtils.sendTitle("§eLook away!", 150) - } - } -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/TubulatorParkour.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/TubulatorParkour.kt deleted file mode 100644 index 5b476962b..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/TubulatorParkour.kt +++ /dev/null @@ -1,70 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.CheckRenderEntityEvent -import at.hannibal2.skyhanni.events.ConfigLoadEvent -import at.hannibal2.skyhanni.events.RepositoryReloadEvent -import at.hannibal2.skyhanni.utils.LocationUtils.isPlayerInside -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor -import at.hannibal2.skyhanni.utils.ParkourHelper -import at.hannibal2.skyhanni.utils.jsonobjects.ParkourJson -import net.minecraft.util.AxisAlignedBB -import net.minecraftforge.client.event.RenderWorldLastEvent -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class TubulatorParkour { - private val config get() = SkyHanniMod.feature.rift.mirrorVerse.tubulatorConfig - private var parkourHelper: ParkourHelper? = null - private val puzzleRoom = AxisAlignedBB(-298.0, 0.0, -112.0, -309.0, 63.0, -101.0) - - @SubscribeEvent - fun onRepoReload(event: RepositoryReloadEvent) { - val data = event.getConstant("RiftTubulator") ?: return - parkourHelper = ParkourHelper( - data.locations, - data.shortCuts, - platformSize = 1.0, - detectionRange = 2.0, - ) - updateConfig() - } - - @SubscribeEvent - fun onCheckRender(event: CheckRenderEntityEvent<*>) { - if (!isEnabled()) return - if (!config.hidePlayers) return - - parkourHelper?.let { - if (it.inParkour()) { - event.isCanceled = true - } - } - } - - @SubscribeEvent - fun onConfigLoad(event: ConfigLoadEvent) { - LorenzUtils.onToggle(config.rainbowColor, config.monochromeColor, config.lookAhead) { - updateConfig() - } - } - - private fun updateConfig() { - parkourHelper?.run { - rainbowColor = config.rainbowColor.get() - monochromeColor = config.monochromeColor.get().toChromaColor() - lookAhead = config.lookAhead.get() + 1 - outline = config.outline - } - } - - @SubscribeEvent - fun onRenderWorld(event: RenderWorldLastEvent) { - if (!isEnabled()) return - - parkourHelper?.render(event) - } - - fun isEnabled() = - RiftAPI.inRift() && LorenzUtils.skyBlockArea == "Mirrorverse" && config.enabled && puzzleRoom.isPlayerInside() -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/VoltHighlighter.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/VoltHighlighter.kt deleted file mode 100644 index 4b03e9b6c..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/VoltHighlighter.kt +++ /dev/null @@ -1,119 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.EntityEquipmentChangeEvent -import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper -import at.hannibal2.skyhanni.utils.ItemUtils.getSkullTexture -import at.hannibal2.skyhanni.utils.LorenzUtils.editCopy -import at.hannibal2.skyhanni.utils.RenderUtils -import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText -import at.hannibal2.skyhanni.utils.RenderUtils.exactLocation -import at.hannibal2.skyhanni.utils.SimpleTimeMark -import at.hannibal2.skyhanni.utils.SpecialColour -import at.hannibal2.skyhanni.utils.TimeUtils -import net.minecraft.client.Minecraft -import net.minecraft.entity.Entity -import net.minecraft.entity.EntityLivingBase -import net.minecraft.entity.item.EntityArmorStand -import net.minecraft.item.ItemStack -impor