summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data
diff options
context:
space:
mode:
authorThunderblade73 <85900443+Thunderblade73@users.noreply.github.com>2023-10-30 20:02:47 +0100
committerGitHub <noreply@github.com>2023-10-30 20:02:47 +0100
commit572e159de71827c5c8a6433de90adba2ebec5c4a (patch)
treec076567ec200e9357d85182a4b1d559078124119 /src/main/java/at/hannibal2/skyhanni/data
parenta58db22daeeec2477a65f4e585aa62e89d9d2176 (diff)
downloadskyhanni-572e159de71827c5c8a6433de90adba2ebec5c4a.tar.gz
skyhanni-572e159de71827c5c8a6433de90adba2ebec5c4a.tar.bz2
skyhanni-572e159de71827c5c8a6433de90adba2ebec5c4a.zip
NullPointerException fix for getEntityByID (#652)
Fixed rare error message while disconnecting. #652
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/EntityData.kt7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/EntityData.kt b/src/main/java/at/hannibal2/skyhanni/data/EntityData.kt
index b26312b51..1ffa5a70b 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/EntityData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/EntityData.kt
@@ -6,9 +6,9 @@ import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.PacketEvent
import at.hannibal2.skyhanni.utils.EntityUtils
+import at.hannibal2.skyhanni.utils.EntityUtils.getEntityByID
import at.hannibal2.skyhanni.utils.LorenzUtils.baseMaxHealth
import at.hannibal2.skyhanni.utils.LorenzUtils.derpy
-import net.minecraft.client.Minecraft
import net.minecraft.client.entity.EntityOtherPlayerMP
import net.minecraft.client.entity.EntityPlayerSP
import net.minecraft.entity.EntityLivingBase
@@ -50,8 +50,7 @@ class EntityData {
val watchableObjects = packet.func_149376_c() ?: return
val entityId = packet.entityId
- val theWorld = Minecraft.getMinecraft().theWorld ?: return
- val entity = theWorld.getEntityByID(entityId) ?: return
+ val entity = getEntityByID(entityId) ?: return
if (entity is EntityArmorStand) return
if (entity is EntityXPOrb) return
if (entity is EntityItem) return
@@ -77,4 +76,4 @@ class EntityData {
}
}
}
-} \ No newline at end of file
+}