summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/misc
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/features/misc
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/features/misc')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt
index 83fd1ac52..3475802dd 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt
@@ -14,6 +14,7 @@ import at.hannibal2.skyhanni.features.garden.farming.GardenCropSpeed
import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper
import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled
import at.hannibal2.skyhanni.test.command.ErrorManager
+import at.hannibal2.skyhanni.utils.EntityUtils.getEntityByID
import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer
import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils
@@ -211,9 +212,9 @@ object TrevorFeatures {
@SubscribeEvent
fun onRenderWorld(event: LorenzRenderWorldEvent) {
if (!onFarmingIsland()) return
- var entityTrapper = Minecraft.getMinecraft().theWorld.getEntityByID(trapperID)
+ var entityTrapper = getEntityByID(trapperID)
if (entityTrapper !is EntityLivingBase) entityTrapper =
- Minecraft.getMinecraft().theWorld.getEntityByID(backupTrapperID)
+ getEntityByID(backupTrapperID)
if (entityTrapper is EntityLivingBase && config.trapperTalkCooldown) {
RenderLivingEntityHelper.setEntityColor(entityTrapper, currentStatus.color)
{ config.trapperTalkCooldown }