Skip to content

Instantly share code, notes, and snippets.

@AIGLEZMA
Forked from zyuiop/Example.java
Created January 30, 2020 20:15
Show Gist options
  • Save AIGLEZMA/09756ac4ffa034195ee7820dbe00c445 to your computer and use it in GitHub Desktop.
Save AIGLEZMA/09756ac4ffa034195ee7820dbe00c445 to your computer and use it in GitHub Desktop.
Blocking world downloader
class Example extends JavaPlugin {
public void onEnable() {
Bukkit.getMessenger().registerOutgoingPluginChannel(this, "WDL|CONTROL");
Bukkit.getMessenger().registerIncomingPluginChannel(this, "WDL|INIT", (s, player, bytes) -> {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeInt(1);
out.writeBoolean(false);
out.writeInt(1);
out.writeBoolean(false);
out.writeBoolean(false);
out.writeBoolean(false);
out.writeBoolean(false);
Bukkit.getLogger().info("Blocking WorldDownloader for " + player.getDisplayName());
player.sendPluginMessage(this, "WDL|CONTROL", out.toByteArray());
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment