Skip to content
This repository was archived by the owner on Feb 15, 2022. It is now read-only.

Commit f3cee89

Browse files
committed
Updated plugin messages to 1.13+
1 parent 3ae128a commit f3cee89

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

blccpsapibukkit/src/main/java/net/badlion/blccpsapibukkit/BlcCpsApiBukkit.java

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

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

3125
if (!this.getDataFolder().exists()) {
3226
if (!this.getDataFolder().mkdir()) {
@@ -38,7 +32,7 @@ public void onEnable() {
3832
this.conf = loadConf(new File(this.getDataFolder(), "config.json"));
3933

4034
// Register channel
41-
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BLC|C");
35+
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "badlion:cps");
4236

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

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

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

130130
// Create data we need for packet;
131-
String channel = "BLC|C";
131+
String channel = "badlion:cps";
132132
byte[] message = BlcCpsApiBukkit.GSON_NON_PRETTY.toJson(this.plugin.getConf()).getBytes();
133133

134134
try {

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

Lines changed: 1 addition & 5 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 {
@@ -16,13 +15,10 @@ public PlayerListener(BlcCpsApiBungee plugin) {
1615
this.plugin = plugin;
1716
}
1817

19-
2018
@EventHandler
2119
public void onLogin(PostLoginEvent event) {
2220
// Send the click speed limitation to players when they login to the proxy. A notification will appear on the Badlion Client so they know their CPS has been limited
2321
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|C", BlcCpsApiBungee.GSON_NON_PRETTY.toJson( this.plugin.getConf() ).getBytes(), false ) );
26-
}
22+
player.unsafe().sendPacket(new PluginMessage("badlion:cps", BlcCpsApiBungee.GSON_NON_PRETTY.toJson(this.plugin.getConf()).getBytes(), false));
2723
}
2824
}

0 commit comments

Comments
 (0)