From eaa2b8412f96b7492982810122c51c39659d011a Mon Sep 17 00:00:00 2001 From: syeyoung <42869671+cyoung06@users.noreply.github.com> Date: Mon, 27 Feb 2023 15:15:44 +0900 Subject: Skyblock dungeons guide 345 (#347) * - Fix #345, DG unload incompatibility with essential due to "thePlayer" not being EntityPlayerSP but some kind of wierd player emulated by Essential - Fix unloading error mentioned in #345, JarLoader popping ProgressBar that doesn't exist Signed-off-by: syeyoung * - Additional Checks on EntityPlayerSP Signed-off-by: syeyoung --------- Signed-off-by: syeyoung --- .../main/java/kr/syeyoung/dungeonsguide/mod/DungeonsGuide.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'mod/src/main') diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/DungeonsGuide.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/DungeonsGuide.java index f4ec6ec0..c55d21cd 100755 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/DungeonsGuide.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/DungeonsGuide.java @@ -343,8 +343,10 @@ public class DungeonsGuide implements DGInterface { if (packetInjector != null) packetInjector.cleanup(); try { - EntityPlayerSP ep = (EntityPlayerSP) Minecraft.getMinecraft().getRenderManager().livingPlayer; - transform(ep); + if (Minecraft.getMinecraft().getRenderManager().livingPlayer instanceof AbstractClientPlayer) { + AbstractClientPlayer ep = (AbstractClientPlayer) Minecraft.getMinecraft().getRenderManager().livingPlayer; + transform(ep); + } } catch (Exception e) { e.printStackTrace(); } @@ -358,7 +360,8 @@ public class DungeonsGuide implements DGInterface { e.printStackTrace(); } NetHandlerPlayClient netHandlerPlayClient = Minecraft.getMinecraft().getNetHandler(); - if (netHandlerPlayClient == null && (Minecraft.getMinecraft().getRenderManager().livingPlayer) != null) + if (netHandlerPlayClient == null && (Minecraft.getMinecraft().getRenderManager().livingPlayer) != null + && Minecraft.getMinecraft().getRenderManager().livingPlayer instanceof EntityPlayerSP) netHandlerPlayClient = ((EntityPlayerSP) Minecraft.getMinecraft().getRenderManager().livingPlayer).sendQueue; if (netHandlerPlayClient != null) { -- cgit