From 06f2ed966ed82ea20b70757137d84a904ce177a8 Mon Sep 17 00:00:00 2001 From: LittleShyStar02 Date: Thu, 31 Oct 2024 16:44:27 +0100 Subject: [PATCH] Actually check if the channel is open, fixes #547 (#557) * Moved check of channel open of #547. In previous point was always true and it did not solve problem. * Moved check of channel open of #547. In previous point was always true and it did not solve problem. * Make the comment more compact --------- Co-authored-by: Tim203 --- .../org/geysermc/floodgate/inject/bungee/BungeeInjector.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bungee/src/main/java/org/geysermc/floodgate/inject/bungee/BungeeInjector.java b/bungee/src/main/java/org/geysermc/floodgate/inject/bungee/BungeeInjector.java index 21967142..f58c8001 100644 --- a/bungee/src/main/java/org/geysermc/floodgate/inject/bungee/BungeeInjector.java +++ b/bungee/src/main/java/org/geysermc/floodgate/inject/bungee/BungeeInjector.java @@ -91,11 +91,12 @@ public void inject() { ChannelInitializer wrapper = new ChannelInitializer() { @Override protected void initChannel(Channel channel) { + ReflectionUtils.invoke(original, initChannelMethod, channel); // Check if the channel is open, see #547 if (!channel.isOpen()) { return; } - ReflectionUtils.invoke(original, initChannelMethod, channel); + channel.pipeline().addBefore( PipelineUtils.FRAME_DECODER, BUNGEE_INIT, new BungeeClientToProxyInjectInitializer(BungeeInjector.this)