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/event | |
| 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/event')
4 files changed, 11 insertions, 84 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt index 4e18251b5..f7004074b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt @@ -96,10 +96,8 @@ object GriffinBurrowHelper { @SubscribeEvent fun onPlayerMove(event: EntityMoveEvent) { - if (event.distance > 10) { - if (event.entity == Minecraft.getMinecraft().thePlayer) { - teleportedLocation = event.newLocation - } + if (event.distance > 10 && event.entity == Minecraft.getMinecraft().thePlayer) { + teleportedLocation = event.newLocation } } @@ -172,10 +170,8 @@ object GriffinBurrowHelper { } } - if (InquisitorWaypointShare.waypoints.isNotEmpty()) { - if (config.inquisitorSharing.focusInquisitor) { - return - } + if (InquisitorWaypointShare.waypoints.isNotEmpty() && config.inquisitorSharing.focusInquisitor) { + return } if (config.burrowsNearbyDetection) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt index a4ca74ff4..9d6a90135 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt @@ -26,61 +26,6 @@ class GriffinBurrowParticleFinder { private val burrows = mutableMapOf<LorenzVec, Burrow>() var lastDugParticleBurrow: LorenzVec? = null - // private enum class ParticleType(val check: ReceiveParticleEvent.() -> Boolean) { -// EMPTY({ -// type == net.minecraft.util.EnumParticleTypes.CRIT_MAGIC && count == 4 && speed == 0.01f && offset.x == 0.5 && offset.y == 0.1 && offset.z == 0.5 -// }), -// MOB({ -// type == net.minecraft.util.EnumParticleTypes.CRIT && count == 3 && speed == 0.01f && offset.x == 0.5 && offset.y == 0.1 && offset.z == 0.5 -// -// }), -// TREASURE({ -// type == net.minecraft.util.EnumParticleTypes.DRIP_LAVA && count == 2 && speed == 0.01f && offset.x == 0.35 && offset.y == 0.1 && offset.z == 0.35 -// }), -// FOOTSTEP({ -// type == net.minecraft.util.EnumParticleTypes.FOOTSTEP && count == 1 && speed == 0.0f && offset.x == 0.05 && offset.y == 0.0 && offset.z == 0.05 -// }), -// ENCHANT({ -// type == net.minecraft.util.EnumParticleTypes.ENCHANTMENT_TABLE && count == 5 && speed == 0.05f && offset.x == 0.5 && offset.y == 0.4 && offset.z == 0.5 -// }); -// -// companion object { -// fun getParticleType(packet: ReceiveParticleEvent): ParticleType? { -// if (!packet.longDistance) return null -// for (type in values()) { -// if (type.check(packet)) { -// return type -// } -// } -// return null -// } -// } -// } -// -// @SubscribeEvent -// fun onChatPacket(event: ReceiveParticleEvent) { -// if (!LorenzUtils.inSkyBlock) return -// if (!SkyHanniMod.feature.dev.debugEnabled) return -// -// val particleType = getParticleType(event) -// if (particleType != null) { -// -// val location = event.location.toBlocPos().down().toLorenzVec() -// if (recentlyDugParticleBurrows.contains(location)) return -// val burrow = particleBurrows.getOrPut(location) { ParticleBurrow(location) } -// -// when (particleType) { -// ParticleType.FOOTSTEP -> burrow.hasFootstep = true -// ParticleType.ENCHANT -> burrow.hasEnchant = true -// ParticleType.EMPTY -> burrow.type = 0 -// ParticleType.MOB -> burrow.type = 1 -// ParticleType.TREASURE -> burrow.type = 2 -// } -// -// } -// -// } - @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true) fun onChatPacket(event: PacketEvent.ReceiveEvent) { if (!LorenzUtils.inSkyBlock) return @@ -207,15 +152,5 @@ class GriffinBurrowParticleFinder { else -> BurrowType.UNKNOWN } } - -// private fun getWaypointText(): String { -// var type = "Burrow" -// when (this.type) { -// 0 -> type = "§aStart" -// 1 -> type = "§cMob" -// 2 -> type = "§6Treasure" -// } -// return "$type §a(Particle)" -// } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinPetWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinPetWarning.kt index 679c493ca..e5838aec8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinPetWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinPetWarning.kt @@ -21,12 +21,10 @@ class GriffinPetWarning { if (!DianaAPI.isRitualActive()) return if (!DianaAPI.hasSpadeInHand()) return - if (!DianaAPI.hasGriffinPet()) { - if (lastWarnTime.passedSince() > 30.seconds) { - lastWarnTime = SimpleTimeMark.now() - TitleUtils.sendTitle("§cGriffin Pet!", 3.seconds) - LorenzUtils.chat("§e[SkyHanni] Reminder to use a Griffin pet for Mythological Ritual!") - } + if (!DianaAPI.hasGriffinPet() && lastWarnTime.passedSince() > 30.seconds) { + lastWarnTime = SimpleTimeMark.now() + TitleUtils.sendTitle("§cGriffin Pet!", 3.seconds) + LorenzUtils.chat("§e[SkyHanni] Reminder to use a Griffin pet for Mythological Ritual!") } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt index 18f8c6f7d..5f0437ebe 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt @@ -97,11 +97,9 @@ object InquisitorWaypointShare { } // TODO: Change the check to only one line once we have a confirmed inquis message line - if (message.contains("§r§eYou dug out ")) { - if (message.contains("Inquis")) { - time = System.currentTimeMillis() - logger.log("found Inquisitor") - } + if (message.contains("§r§eYou dug out ") && message.contains("Inquis")) { + time = System.currentTimeMillis() + logger.log("found Inquisitor") } } |
