diff options
author | Walker Selby <git@walkerselby.com> | 2023-09-29 11:30:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-29 20:30:27 +0200 |
commit | 343d5d9cea12beaf7a8dfabda2f61ad940be592a (patch) | |
tree | ceb0a82790eaa1a1babfe4a2e05220378037a748 /src/main/java/at/hannibal2/skyhanni/features/rift | |
parent | b364b6da62668ea44dfc23180fe70c13ec707804 (diff) | |
download | skyhanni-343d5d9cea12beaf7a8dfabda2f61ad940be592a.tar.gz skyhanni-343d5d9cea12beaf7a8dfabda2f61ad940be592a.tar.bz2 skyhanni-343d5d9cea12beaf7a8dfabda2f61ad940be592a.zip |
Random Code Cleanup (#516)
Sonar Lint for the win #516
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/rift')
8 files changed, 18 insertions, 36 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftWiltedBerberisHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftWiltedBerberisHelper.kt index 3dcf22b6b..1ea1e6f5e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftWiltedBerberisHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftWiltedBerberisHelper.kt @@ -61,16 +61,12 @@ class RiftWiltedBerberisHelper { if (!isEnabled()) return if (!hasFarmingToolInHand) return -// if (event.distanceToPlayer > 10) return - val location = event.location val berberis = nearestBerberis(location) if (event.type != EnumParticleTypes.FIREWORKS_SPARK) { - if (config.hideparticles) { - if (berberis != null) { - event.isCanceled = true - } + if (config.hideparticles && berberis != null) { + event.isCanceled = true } return } diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt index 8d09c1e3e..019dab619 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt @@ -55,10 +55,8 @@ class LivingCaveDefenseBlocks { } return } - if (config.hideParticles) { - if (movingBlocks.keys.any { it.location.distance(location) < 3 }) { - event.isCanceled = true - } + if (config.hideParticles && movingBlocks.keys.any { it.location.distance(location) < 3 }) { + event.isCanceled = true } if (event.type == EnumParticleTypes.CRIT_MAGIC) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/DanceRoomHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/DanceRoomHelper.kt index 12f9b35ae..0aefac172 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/DanceRoomHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/DanceRoomHelper.kt @@ -151,10 +151,8 @@ object DanceRoomHelper { fun onCheckRender(event: CheckRenderEntityEvent<*>) { if (RiftAPI.inRift() && config.hidePlayers) { val entity = event.entity - if (entity is EntityOtherPlayerMP) { - if (inRoom) { - event.isCanceled = true - } + if (entity is EntityOtherPlayerMP && inRoom) { + event.isCanceled = true } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt index ad3231e29..723b97a3b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt @@ -127,13 +127,11 @@ class RiftBloodEffigies { continue } - if (config.respawningSoon) { - if (diff < 60_000 * config.respwningSoonTime) { - val time = TimeUtils.formatDuration(diff - 999) - event.drawWaypointFilled(location, LorenzColor.YELLOW.toColor(), seeThroughBlocks = true) - event.drawDynamicText(location, "§e$name is respawning §b$time", 1.5) - continue - } + if (config.respawningSoon && diff < 60_000 * config.respwningSoonTime) { + val time = TimeUtils.formatDuration(diff - 999) + event.drawWaypointFilled(location, LorenzColor.YELLOW.toColor(), seeThroughBlocks = true) + event.drawDynamicText(location, "§e$name is respawning §b$time", 1.5) + continue } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt index 360d2b289..2d04fa7ee 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt @@ -81,10 +81,8 @@ class KloonHacking { 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 + 8 && slot.slotIndex < i * 9 + 18 && slot.stack!!.displayName.removeColor() == correctButtons[i]) { + slot highlight LorenzColor.YELLOW } if (slot.slotIndex == i * 9 + 17) { i += 1 diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt index 3e495ea14..a00f52c63 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt @@ -64,10 +64,8 @@ object EnigmaSoulWaypoints { 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()) - } + if (split.size == 2 && stack.getLore().last() == "§8✖ Not completed yet!") { + inventoryUnfound.add(split.last()) } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/HighlightRiftGuide.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/HighlightRiftGuide.kt index 81def7af1..84cd9b8db 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/HighlightRiftGuide.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/HighlightRiftGuide.kt @@ -31,10 +31,8 @@ class HighlightRiftGuide { val highlightedItems = mutableListOf<Int>() for ((slot, stack) in event.inventoryItems) { val lore = stack.getLore() - if (lore.isNotEmpty()) { - if (lore.last() == "§8✖ Not completed yet!") { - highlightedItems.add(slot) - } + if (lore.isNotEmpty() && lore.last() == "§8✖ Not completed yet!") { + highlightedItems.add(slot) } } inInventory = true diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftHorsezookaHider.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftHorsezookaHider.kt index 8e084f6c8..04c4ba332 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftHorsezookaHider.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftHorsezookaHider.kt @@ -14,10 +14,8 @@ class RiftHorsezookaHider { if (!RiftAPI.inRift()) return if (!SkyHanniMod.feature.rift.horsezookaHider) return - if (event.entity is EntityHorse) { - if (InventoryUtils.itemInHandId.equals("HORSEZOOKA")) { + if (event.entity is EntityHorse && InventoryUtils.itemInHandId.equals("HORSEZOOKA")) { event.isCanceled = true - } } } } |