aboutsummaryrefslogtreecommitdiff
path: root/mod/src/main/java/kr
diff options
context:
space:
mode:
Diffstat (limited to 'mod/src/main/java/kr')
-rwxr-xr-xmod/src/main/java/kr/syeyoung/dungeonsguide/mod/DungeonsGuide.java1
-rw-r--r--mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketInjector.java8
2 files changed, 5 insertions, 4 deletions
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 7a7ba7fb..b0d67ab0 100755
--- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/DungeonsGuide.java
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/DungeonsGuide.java
@@ -304,6 +304,7 @@ public class DungeonsGuide implements DGInterface {
StompManager.getInstance().cleanup();
// have FUN!
+
for (Object registeredListener : registeredListeners) {
MinecraftForge.EVENT_BUS.unregister(registeredListener);
}
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketInjector.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketInjector.java
index 54ba4f8a..676682ff 100644
--- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketInjector.java
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketInjector.java
@@ -93,16 +93,16 @@ public class PacketInjector extends ChannelDuplexHandler {
super.write(ctx, msg, promise);
}
- private ChannelPipeline thePipeline;
+
@SubscribeEvent
public void onServerConnect(FMLNetworkEvent.ClientConnectedToServerEvent event) {
- (thePipeline =event.manager.channel().pipeline()).addBefore("packet_handler", "dg_packet_handler", this);
+ event.manager.channel().pipeline().addBefore("packet_handler", "dg_packet_handler", this);
}
public void cleanup() {
try {
- if (thePipeline != null)
- thePipeline.remove("dg_packet_handler");
+ if (Minecraft.getMinecraft().getNetHandler() != null)
+ Minecraft.getMinecraft().getNetHandler().getNetworkManager().channel().pipeline().remove("dg_packet_handler");
} catch (Exception e) {
}