aboutsummaryrefslogtreecommitdiff
path: root/mod/src/main/java/kr/syeyoung
diff options
context:
space:
mode:
authorsyeyoung <cyoung06@naver.com>2022-11-17 22:53:32 +0900
committersyeyoung <cyoung06@naver.com>2022-11-17 22:53:32 +0900
commit5ba0fb7ab33e71d28e62910568de0865bbfe3c8c (patch)
tree9aee86861f73eac0391d526e2af542f59758e192 /mod/src/main/java/kr/syeyoung
parent600cdd77c0c1bbb79fff9c5ed06d45de2bd0528b (diff)
downloadSkyblock-Dungeons-Guide-5ba0fb7ab33e71d28e62910568de0865bbfe3c8c.tar.gz
Skyblock-Dungeons-Guide-5ba0fb7ab33e71d28e62910568de0865bbfe3c8c.tar.bz2
Skyblock-Dungeons-Guide-5ba0fb7ab33e71d28e62910568de0865bbfe3c8c.zip
- Unload packet handler
Signed-off-by: syeyoung <cyoung06@naver.com>
Diffstat (limited to 'mod/src/main/java/kr/syeyoung')
-rw-r--r--mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketListener.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketListener.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketListener.java
index fe907a5b..acfffb7c 100644
--- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketListener.java
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketListener.java
@@ -18,10 +18,7 @@
package kr.syeyoung.dungeonsguide.mod.events.listener;
-import io.netty.channel.ChannelDuplexHandler;
-import io.netty.channel.ChannelHandler;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.channel.ChannelPromise;
+import io.netty.channel.*;
import kr.syeyoung.dungeonsguide.mod.DungeonsGuide;
import kr.syeyoung.dungeonsguide.mod.SkyblockStatus;
import kr.syeyoung.dungeonsguide.mod.cosmetics.CustomPacketPlayerListItem;
@@ -184,8 +181,13 @@ public class PacketListener extends ChannelDuplexHandler {
super.write(ctx, msg, promise);
}
+ private ChannelPipeline thePipeline;
@SubscribeEvent
public void onServerConnect(FMLNetworkEvent.ClientConnectedToServerEvent event) {
- event.manager.channel().pipeline().addBefore("packet_handler", "dg_packet_handler", this);
+ (thePipeline =event.manager.channel().pipeline()).addBefore("packet_handler", "dg_packet_handler", this);
+ }
+
+ public void cleanup() {
+ thePipeline.remove("dg_packet_handler");
}
}