From 6c968778dab9c04b0ff4fec7b4eb61f36e23660d Mon Sep 17 00:00:00 2001 From: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Date: Wed, 17 Apr 2024 17:49:07 +0200 Subject: Fix: Removed the Player (#1473) --- src/main/java/at/hannibal2/skyhanni/data/mob/MobDebug.kt | 2 +- src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/data') diff --git a/src/main/java/at/hannibal2/skyhanni/data/mob/MobDebug.kt b/src/main/java/at/hannibal2/skyhanni/data/mob/MobDebug.kt index a1e894d32..bb9eb7ac0 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/mob/MobDebug.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/mob/MobDebug.kt @@ -46,7 +46,7 @@ class MobDebug { fun onWorldRenderDebug(event: LorenzRenderWorldEvent) { if (config.showRayHit || config.showInvisible) { lastRayHit = MobUtils.rayTraceForMobs(Minecraft.getMinecraft().thePlayer, event.partialTicks) - ?.firstOrNull { it.canBeSeen() && (config.showInvisible || it.isInvisible()) } + ?.firstOrNull { it.canBeSeen() && (!config.showInvisible || !it.isInvisible()) } } if (config.skyblockMob.isHighlight()) { diff --git a/src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt b/src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt index d3f8601d2..b31b2a47b 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt @@ -8,7 +8,6 @@ import at.hannibal2.skyhanni.data.mob.MobFilter.isRealPlayer import at.hannibal2.skyhanni.data.mob.MobFilter.isSkyBlockMob import at.hannibal2.skyhanni.events.DebugDataCollectEvent import at.hannibal2.skyhanni.events.EntityHealthUpdateEvent -import at.hannibal2.skyhanni.events.IslandChangeEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.MobEvent import at.hannibal2.skyhanni.events.PacketEvent @@ -20,7 +19,7 @@ import at.hannibal2.skyhanni.utils.EntityUtils import at.hannibal2.skyhanni.utils.LocationUtils import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.getLorenzVec -import net.minecraft.client.Minecraft +import net.minecraft.client.entity.EntityPlayerSP import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.item.EntityArmorStand import net.minecraft.entity.monster.EntityCreeper @@ -96,7 +95,7 @@ class MobDetection { MobData.previousEntityLiving.addAll(MobData.currentEntityLiving) MobData.currentEntityLiving.clear() MobData.currentEntityLiving.addAll(EntityUtils.getEntities() - .filter { it !is EntityArmorStand }) + .filter { it !is EntityArmorStand && it !is EntityPlayerSP }) if (forceReset) { MobData.currentEntityLiving.clear() // Naturally removing the mobs using the despawn @@ -319,11 +318,6 @@ class MobDetection { } } - @SubscribeEvent - fun onIslandChange(event: IslandChangeEvent) { - MobData.currentEntityLiving.remove(Minecraft.getMinecraft().thePlayer) // Fix for the Player - } - private val allEntitiesViaPacketId = mutableSetOf() private fun addEntityUpdate(id: Int) = if (allEntitiesViaPacketId.contains(id)) { -- cgit