From 90a461272845451bb0188b7d4bda30a64ce8cc6a Mon Sep 17 00:00:00 2001 From: CTAK-CO6AK <72935702+CTAK-CO6AK@users.noreply.github.com> Date: Thu, 4 Mar 2021 14:08:26 +0400 Subject: [PATCH] Now not displaying entity when it is unloaded Fixes #82 --- src/main/java/net/torocraft/torohealth/display/Hud.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/torocraft/torohealth/display/Hud.java b/src/main/java/net/torocraft/torohealth/display/Hud.java index 559e3e3..3704369 100644 --- a/src/main/java/net/torocraft/torohealth/display/Hud.java +++ b/src/main/java/net/torocraft/torohealth/display/Hud.java @@ -99,7 +99,12 @@ private void draw(MatrixStack matrix, float x, float y, float scale) { if (entity == null) { return; } - + + if(client.world.getEntityById(entity.getEntityId()) != entity) { + setEntityWork(null); + return; + } + matrix.push(); matrix.scale(scale, scale, scale); matrix.translate(x - 10, y - 10, 0);