Skip to content

Instantly share code, notes, and snippets.

@zyuiop
Created August 8, 2015 15:25
Show Gist options
  • Save zyuiop/4e129c12c49c411048fc to your computer and use it in GitHub Desktop.
Save zyuiop/4e129c12c49c411048fc 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());
});
}
}
@kyriog
Copy link

kyriog commented Aug 8, 2015

Mes yeux pleurent devant cette indentation 😿

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment