diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-22 12:53:20 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-22 12:53:20 +0100 |
commit | 7137b0a07ba4c4efe65282a18ebc68f25ffa1796 (patch) | |
tree | ba69ae6e3ba3c758906dfad41b9035af258e923c /src/main/java/at/hannibal2/skyhanni | |
parent | 4ff0a7de8109b748cdaa707e9714478140095171 (diff) | |
download | skyhanni-7137b0a07ba4c4efe65282a18ebc68f25ffa1796.tar.gz skyhanni-7137b0a07ba4c4efe65282a18ebc68f25ffa1796.tar.bz2 skyhanni-7137b0a07ba4c4efe65282a18ebc68f25ffa1796.zip |
The cleanup after the cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
17 files changed, 52 insertions, 48 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt index b9088bac6..8448627f5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt @@ -37,9 +37,8 @@ class PlayerDeathMessages { val message = event.message deathMessagePattern.matchMatcher(message) { val name = group("name") - if (SkyHanniMod.feature.markedPlayers.highlightInChat && !LorenzUtils.inDungeons && !LorenzUtils.inKuudraFight && MarkedPlayerManager.isMarkedPlayer( - name - ) + if (SkyHanniMod.feature.markedPlayers.highlightInChat && + !LorenzUtils.inDungeons && !LorenzUtils.inKuudraFight && MarkedPlayerManager.isMarkedPlayer(name) ) { val reason = group("reason").removeColor() LorenzUtils.chat(" §c☠ §e$name §7$reason", false) @@ -47,12 +46,8 @@ class PlayerDeathMessages { return } - - if (isHideFarDeathsEnabled() && System.currentTimeMillis() > lastTimePlayerSeen.getOrDefault( - name, - 0 - ) + 30_000 - ) { + val time = System.currentTimeMillis() > lastTimePlayerSeen.getOrDefault(name, 0) + 30_000 + if (isHideFarDeathsEnabled() && time) { event.blockedReason = "far_away_player_death" } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt index 5a01eae76..da2d35e0d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt @@ -27,6 +27,8 @@ class DungeonHideItems { private val hideParticles = mutableMapOf<EntityArmorStand, Long>() private val movingSkeletonSkulls = mutableMapOf<EntityArmorStand, Long>() + // TODO put in skull data repo part + private val soulWeaverHider = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmYyNGVkNjg3NTMwNGZhNGExZjBjNzg1YjJjYjZhNmE3MjU2M2U5ZjNlMjRlYTU1ZTE4MTc4NDUyMTE5YWE2NiJ9fX0=" private val blessingTexture = diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt index fbf6a3850..b3a6a1f59 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt @@ -12,6 +12,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.concurrent.fixedRateTimer class DungeonMilestonesDisplay { + private val config get() = SkyHanniMod.feature.dungeon companion object { private var display = "" @@ -83,13 +84,8 @@ class DungeonMilestonesDisplay { fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { if (!isEnabled()) return - SkyHanniMod.feature.dungeon.showMileStonesDisplayPos.renderString( - color + display, - posLabel = "Dungeon Milestone" - ) + config.showMileStonesDisplayPos.renderString(color + display, posLabel = "Dungeon Milestone") } - private fun isEnabled(): Boolean { - return LorenzUtils.inDungeons && SkyHanniMod.feature.dungeon.showMilestonesDisplay - } + private fun isEnabled() = LorenzUtils.inDungeons && config.showMilestonesDisplay } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/anniversary/Year300RaffleEvent.kt b/src/main/java/at/hannibal2/skyhanni/features/event/anniversary/Year300RaffleEvent.kt index d636f6810..71d8040f3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/anniversary/Year300RaffleEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/anniversary/Year300RaffleEvent.kt @@ -36,10 +36,8 @@ object Year300RaffleEvent { } } - fun isEnabled() = config.enableActiveTimer && - Instant.now().isBefore(SkyBlockTime(301).toInstant()) && - LorenzUtils.inSkyBlock - + fun isEnabled() = LorenzUtils.inSkyBlock && config.enableActiveTimer && + Instant.now().isBefore(SkyBlockTime(301).toInstant()) @SubscribeEvent fun onRender(event: GuiRenderEvent.GuiOverlayRenderEvent) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt index 70bc23125..dd6664bc7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt @@ -21,6 +21,7 @@ class UpgradePage : FFGuideGUI.FFGuidePage() { val adjustedY = FFGuideGUI.guiTop + 20 + pageScroll val inverseScale = 1 / 0.75f + // TODO fix duplicate drawString lines, add guiLeft, guiTop and inverseScale GlStateManager.scale(0.75f, 0.75f, 1f) GuiRenderUtils.drawString( "Upgrade", diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PlayerChatSymbols.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PlayerChatSymbols.kt index 2f47b3db1..5133e65be 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/PlayerChatSymbols.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PlayerChatSymbols.kt @@ -72,9 +72,8 @@ class PlayerChatSymbols { if (!component.text_skyhanni().contains(rankAndName)) return false val oldText = component.text_skyhanni() - component.setText_skyhanni( - component.text_skyhanni().replace(oldText, getNewText(emblemText, oldText, rankAndName)) - ) + val newText = getNewText(emblemText, oldText, rankAndName) + component.setText_skyhanni(component.text_skyhanni().replace(oldText, newText)) return true } 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 780ed54c7..141870585 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 @@ -371,10 +371,10 @@ enum class DiscordStatus(private val displayMessageSupplier: Supplier<String>?) }), AFK({ - if (beenAfkFor.passedSince() > 5.minutes) "AFK for ${ - beenAfkFor.passedSince().format(maxUnits = 1, longName = true) - }" - else AutoStatus.AFK.placeholderText + if (beenAfkFor.passedSince() > 5.minutes) { + val format = beenAfkFor.passedSince().format(maxUnits = 1, longName = true) + "AFK for $format" + } else AutoStatus.AFK.placeholderText }) ; diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt index 7586805df..318d4c1f0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt @@ -232,8 +232,9 @@ object TrevorFeatures { location = LorenzVec(location.x, TrevorSolver.averageHeight, location.z) } if (TrevorSolver.mobLocation == CurrentMobArea.FOUND) { - val displayName = - if (TrevorSolver.currentMob == null) "Mob Location" else TrevorSolver.currentMob!!.mobName + val displayName = if (TrevorSolver.currentMob == null) "Mob Location" else { + TrevorSolver.currentMob!!.mobName + } location = TrevorSolver.mobCoordinates event.drawWaypointFilled(location.add(0, -2, 0), LorenzColor.GREEN.toColor(), true, true) event.drawDynamicText(location.add(0, 1, 0), displayName, 1.5) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/VisualWordGui.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/VisualWordGui.kt index b6a8feca2..a996d7277 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/VisualWordGui.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/VisualWordGui.kt @@ -283,6 +283,7 @@ open class VisualWordGui : GuiScreen() { GlStateManager.scale(0.75f, 0.75f, 1f) + // TODO remove more code duplication drawUnmodifiedString( "§bThe top line of each section", (guiLeft + 10) * inverseScale, diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt index be90eec14..79a1a5361 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt @@ -55,10 +55,10 @@ class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHel } } - private fun needMiniBossQuest(miniBoss: CrimsonMiniBoss): Boolean { - val bossQuest = reputationHelper.questHelper.getQuest<MiniBossQuest>() - return bossQuest != null && bossQuest.miniBoss == miniBoss && bossQuest.state == QuestState.ACCEPTED - } + private fun needMiniBossQuest(miniBoss: CrimsonMiniBoss) = + reputationHelper.questHelper.getQuest<MiniBossQuest>()?.let { + it.miniBoss == miniBoss && it.state == QuestState.ACCEPTED + } ?: false private fun finished(miniBoss: CrimsonMiniBoss) { reputationHelper.questHelper.finishMiniBoss(miniBoss) diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt index 780d8494c..ab3fa40c1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt @@ -29,8 +29,7 @@ object RiftAPI { fun inLivingCave() = LorenzUtils.skyBlockArea == "Living Cave" fun inLivingStillness() = LorenzUtils.skyBlockArea == "Living Stillness" - fun inStillgoreChateau() = - LorenzUtils.skyBlockArea == "Stillgore Château" || LorenzUtils.skyBlockArea == "Oubliette" + fun inStillgoreChateau() = LorenzUtils.skyBlockArea.let { it == "Stillgore Château" || it == "Oubliette" } fun inDreadfarm() = LorenzUtils.skyBlockArea == "Dreadfarm" } diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerType.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerType.kt index a536398a7..44937dd7f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerType.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerType.kt @@ -15,6 +15,4 @@ enum class SlayerType(val displayName: String, val clazz: Class<*>) { INFERNO("Inferno Demonlord", EntityBlaze::class.java), VAMPIRE("Riftstalker Bloodfiend", EntityOtherPlayerMP::class.java) ; - - companion object } diff --git a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt index 602a610df..6d206bf17 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt @@ -18,6 +18,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class SummoningSoulsName { + // TODO repo private val texture = "ewogICJ0aW1lc3RhbXAiIDogMTYwMTQ3OTI2NjczMywKICAicHJvZmlsZUlkIiA6ICJmMzA1ZjA5NDI0NTg0ZjU" + "4YmEyYjY0ZjAyZDcyNDYyYyIsCiAgInByb2ZpbGVOYW1lIiA6ICJqcm9ja2EzMyIsCiAgInNpZ25hdH" + diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt index 8eadaa3e4..f639fbe04 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/FontRendererHook.kt @@ -141,6 +141,7 @@ object FontRendererHook { return if (LorenzUtils.inSkyBlock && !SkyHanniMod.feature.chroma.enabled) constant else "0123456789abcdefklmnorz" } + // TODO add better parameter names @JvmStatic fun toggleChromaCondition_shouldResetStyles( text: String, diff --git a/src/main/java/at/hannibal2/skyhanni/utils/CachedItemData.kt b/src/main/java/at/hannibal2/skyhanni/utils/CachedItemData.kt index 78cc8684d..9d00958f2 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/CachedItemData.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/CachedItemData.kt @@ -1,18 +1,24 @@ package at.hannibal2.skyhanni.utils data class CachedItemData( - /** -1 = not loaded */ + // -1 = not loaded var petCandies: Int? = -1, - /** "" = not loaded */ + + // "" = not loaded var heldItem: String? = "", - /** -1 = not loaded */ + + // -1 = not loaded var sackInASack: Int? = -1, - /** null = not loaded */ + + // null = not loaded var riftTransferable: Boolean? = null, - /** null = not loaded */ + + // null = not loaded var riftExportable: Boolean? = null, - /** null = not loaded */ + + // null = not loaded var itemRarityLastCheck: Long = 0L, // Cant use SimpleTimeMark here - /** null = not loaded */ + + // null = not loaded var itemRarity: LorenzRarity? = null, ) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt b/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt index e8acae501..68f7a0d49 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ParkourHelper.kt @@ -53,9 +53,9 @@ class ParkourHelper( if (visible) { for ((index, location) in locations.withIndex()) { - if (location.offsetCenter() - .distanceToPlayer() < detectionRange && Minecraft.getMinecraft().thePlayer.onGround - ) { + val onGround = Minecraft.getMinecraft().thePlayer.onGround + val closeEnough = location.offsetCenter().distanceToPlayer() < detectionRange + if (closeEnough && onGround) { current = index } } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderHelper.kt b/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderHelper.kt index 790550103..2576b4248 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/shader/ShaderHelper.kt @@ -1,7 +1,13 @@ package at.hannibal2.skyhanni.utils.shader import at.hannibal2.skyhanni.utils.LorenzUtils -import org.lwjgl.opengl.* +import org.lwjgl.opengl.ARBFragmentShader +import org.lwjgl.opengl.ARBShaderObjects +import org.lwjgl.opengl.ARBVertexShader +import org.lwjgl.opengl.ContextCapabilities +import org.lwjgl.opengl.GL11 +import org.lwjgl.opengl.GL20 +import org.lwjgl.opengl.GLContext /** * Class to check shaders support, OpenGL capabilities, and shader helper functions |