Skip to content

Commit 2410f59

Browse files
committed
fixed compatibility for 1.13+ clients
1 parent 71f4fdd commit 2410f59

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

blcmodapibungee/src/main/java/net/badlion/blcmodapibungee/listener/PlayerListener.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import net.md_5.bungee.api.event.PostLoginEvent;
66
import net.md_5.bungee.api.plugin.Listener;
77
import net.md_5.bungee.event.EventHandler;
8+
import net.md_5.bungee.protocol.ProtocolConstants;
89
import net.md_5.bungee.protocol.packet.PluginMessage;
910

1011
public class PlayerListener implements Listener {
@@ -20,7 +21,8 @@ public PlayerListener(BlcModApiBungee plugin) {
2021
public void onLogin(PostLoginEvent event) {
2122
// Send the disallowed mods to players when they login to the proxy. A notification will appear on the Badlion Client so they know the mod was disabled
2223
ProxiedPlayer player = event.getPlayer();
23-
player.unsafe().sendPacket(new PluginMessage("BLC|M", BlcModApiBungee.GSON_NON_PRETTY.toJson(this.plugin.getConf().getModsDisallowed()).getBytes(), false));
24+
if ( player.getPendingConnection().getVersion() <= ProtocolConstants.MINECRAFT_1_12_2 ) { // do not send to 1.13+ clients, this would break the connection
25+
player.unsafe().sendPacket( new PluginMessage( "BLC|M", BlcModApiBungee.GSON_NON_PRETTY.toJson( this.plugin.getConf().getModsDisallowed() ).getBytes(), false ) );
26+
}
2427
}
25-
2628
}

0 commit comments

Comments
 (0)