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 --- .../kr/syeyoung/dungeonsguide/launcher/loader/JarLoader.java | 1 - .../main/java/kr/syeyoung/dungeonsguide/mod/DungeonsGuide.java | 9 ++++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/loader/JarLoader.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/loader/JarLoader.java index d428b1b1..4c2bc666 100644 --- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/loader/JarLoader.java +++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/loader/JarLoader.java @@ -101,7 +101,6 @@ public class JarLoader implements IDGLoader { dgInterface.unload(); } catch (Throwable e) { dgInterface = null; - ProgressStateHolder.pop(); throw new DungeonsGuideUnloadingException(toString(),e); } if (classLoader != null) 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