Skip to content

Commit a6b4073

Browse files
authored
Merge pull request #1 from lukas81298/master
Fixed compatibility with 1.13+ clients
2 parents 71f4fdd + ab34ff4 commit a6b4073

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
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
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<groupId>net.badlion</groupId>
88
<artifactId>badlionclientmodapi</artifactId>
99
<packaging>pom</packaging>
10-
<version>1.0-SNAPSHOT</version>
10+
<version>1.0.1-SNAPSHOT</version>
1111
<modules>
1212
<module>blcmodapibungee</module>
1313
<module>blcmodapibukkit</module>

0 commit comments

Comments
 (0)