From c2cfade4ae1cb1b0936b46ee31aaf8a4086b94de Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 22 Jan 2023 12:45:54 +0100 Subject: Small optimizes. --- src/main/java/at/hannibal2/skyhanni/config/features/Misc.java | 2 +- src/main/java/at/hannibal2/skyhanni/features/misc/HideArmor.kt | 3 ++- .../features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt | 1 - src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java index 2667337af..12df4bca4 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java @@ -141,7 +141,7 @@ public class Misc { @ConfigOption(name = "Reputation Locations", desc = "Show locations to the points where to do stuff in the Crimson Isle to get reputation.") @ConfigEditorBoolean @ConfigAccordionId(id = 6) - public boolean crimsonIsleReputationLocation = true; + public boolean crimsonIsleReputationLocation = false; @Expose @ConfigOption(name = "Exp Bottles", desc = "Hides all the experience bottles lying on the ground.") diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/HideArmor.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/HideArmor.kt index 146a11e3b..aab1db9ad 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/HideArmor.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/HideArmor.kt @@ -80,7 +80,8 @@ class HideArmor { if (slot !in 5..8) continue val armorSlot = (slot - 5) * -1 + 3 - val armor = getCachedArmor(Minecraft.getMinecraft().thePlayer.entityId) + val entityId = Minecraft.getMinecraft()?.thePlayer?.entityId ?: return + val armor = getCachedArmor(entityId) armor[armorSlot] = itemStack val currentScreen = Minecraft.getMinecraft().currentScreen 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 6cce8c68c..17b30087f 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 @@ -73,7 +73,6 @@ class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHel } private fun finished(miniBoss: CrimsonMiniBoss) { - LorenzUtils.debug("Detected mini boss death: ${miniBoss.displayName}") reputationHelper.questHelper.finishMiniBoss(miniBoss) miniBoss.doneToday = true reputationHelper.update() diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt index 3796df912..830e58ce5 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt @@ -631,7 +631,8 @@ object RenderUtils { text: String, scaleMultiplier: Double, yOff: Float = 0f, - hideTooCloseAt: Double = 4.5 + hideTooCloseAt: Double = 4.5, + smallestDistanceVew: Double = 5.0 ) { val thePlayer = Minecraft.getMinecraft().thePlayer val x = location.x @@ -648,7 +649,7 @@ object RenderUtils { (x - renderOffsetX) * (x - renderOffsetX) + (y - (renderOffsetY + eyeHeight)) * (y - (renderOffsetY + eyeHeight)) + (z - renderOffsetZ) * (z - renderOffsetZ) var distToPlayer = sqrt(distToPlayerSq) //TODO this is optional maybe? - distToPlayer = distToPlayer.coerceAtLeast(8.0) + distToPlayer = distToPlayer.coerceAtLeast(smallestDistanceVew) if (distToPlayer < hideTooCloseAt) return -- cgit