Skip to content

Commit 80e72ce

Browse files
committed
Updated plugin messages to 1.13+
1 parent 894646e commit 80e72ce

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

blcmodapibukkit/src/main/java/net/badlion/blcmodapibukkit/BlcModApiBukkit.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ public class BlcModApiBukkit extends JavaPlugin {
2323

2424
@Override
2525
public void onEnable() {
26-
// Only support <= 1.12.2 at the moment, we will add 1.13 support when BLC 1.13 is ready
27-
if (this.getServer().getBukkitVersion().startsWith("1.13")) {
28-
this.getLogger().log(Level.SEVERE, "BLC Mod API is not currently compatible with 1.13 Minecraft. Check back later for updates.");
29-
this.getPluginLoader().disablePlugin(this);
30-
return;
31-
}
3226

3327
if (!this.getDataFolder().exists()) {
3428
if (!this.getDataFolder().mkdir()) {
@@ -40,7 +34,7 @@ public void onEnable() {
4034
this.conf = loadConf(new File(this.getDataFolder(), "config.json"));
4135

4236
// Register channel
43-
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BLC|M");
37+
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "badlion:mods");
4438

4539
// Only register the listener if the config loads successfully
4640
this.getServer().getPluginManager().registerEvents(new PlayerListener(this), this);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public void onPlayerJoin(PlayerJoinEvent event) {
135135
Player player = event.getPlayer();
136136

137137
// Create data we need for packet;
138-
String channel = "BLC|M";
138+
String channel = "badlion:mods";
139139
byte[] message = BlcModApiBukkit.GSON_NON_PRETTY.toJson(this.plugin.getConf().getModsDisallowed()).getBytes();
140140

141141
try {

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
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;
98
import net.md_5.bungee.protocol.packet.PluginMessage;
109

1110
public class PlayerListener implements Listener {
@@ -21,8 +20,6 @@ public PlayerListener(BlcModApiBungee plugin) {
2120
public void onLogin(PostLoginEvent event) {
2221
// 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
2322
ProxiedPlayer player = event.getPlayer();
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-
}
23+
player.unsafe().sendPacket(new PluginMessage("badlion:mods", BlcModApiBungee.GSON_NON_PRETTY.toJson(this.plugin.getConf().getModsDisallowed()).getBytes(), false));
2724
}
2825
}

0 commit comments

Comments
 (0)