From 348aabc99a44e8a3bc80f4722881cde3010173e5 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Wed, 18 May 2022 16:47:38 +0200 Subject: [PATCH] Fix ban message showing Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/listeners/BanListener.java | 4 +++- src/de/steamwar/bungeecore/listeners/mods/Forge.java | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/de/steamwar/bungeecore/listeners/BanListener.java b/src/de/steamwar/bungeecore/listeners/BanListener.java index 43a104f..548058c 100644 --- a/src/de/steamwar/bungeecore/listeners/BanListener.java +++ b/src/de/steamwar/bungeecore/listeners/BanListener.java @@ -21,6 +21,7 @@ package de.steamwar.bungeecore.listeners; import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message; +import de.steamwar.bungeecore.listeners.mods.Forge; import de.steamwar.bungeecore.sql.BannedUserIPs; import de.steamwar.bungeecore.sql.Punishment; import de.steamwar.bungeecore.sql.SteamwarUser; @@ -93,7 +94,8 @@ public class BanListener extends BasicListener { } } } - event.completeIntent(BungeeCore.get()); + + Forge.onServerConnected(event); }); } } diff --git a/src/de/steamwar/bungeecore/listeners/mods/Forge.java b/src/de/steamwar/bungeecore/listeners/mods/Forge.java index 0539713..6d274e6 100644 --- a/src/de/steamwar/bungeecore/listeners/mods/Forge.java +++ b/src/de/steamwar/bungeecore/listeners/mods/Forge.java @@ -60,9 +60,11 @@ public class Forge extends BasicListener { event.setResponse(new FMLPing(event.getResponse(), event.getConnection().getVersion())); } - @EventHandler - public void onServerConnected(LoginEvent event){ - if(event.getConnection().getVersion() < 341) return; //1.13+ + public static void onServerConnected(LoginEvent event) { + if(event.getConnection().getVersion() < 341) { //1.13+ + event.completeIntent(BungeeCore.get()); + return; + } //fml:handshake without mods, channels and registries //for more information see https://wiki.vg/Minecraft_Forge_Handshake#FML2_protocol_.281.13_-_Current.29 @@ -75,10 +77,10 @@ public class Forge extends BasicListener { wrapper = (ChannelWrapper) initialHandlerCh.get(handler); } catch (IllegalAccessException e) { BungeeCore.get().getLogger().log(Level.SEVERE, "Could not get Channel", e); + event.completeIntent(BungeeCore.get()); return; } - event.registerIntent(BungeeCore.get()); ChannelPipeline pipeline = wrapper.getHandle().pipeline(); if(pipeline != null) { HandlerBoss handlerBoss = pipeline.get(HandlerBoss.class);