Advertisement
chooses

Untitled

Aug 20th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.08 KB | None | 0 0
  1. package fr.adQ_Q;
  2.  
  3. import org.bukkit.entity.Player;
  4. import org.bukkit.plugin.Plugin;
  5. import org.bukkit.plugin.java.JavaPlugin;
  6. import com.google.common.io.ByteArrayDataOutput;
  7. import com.google.common.io.ByteStreams;
  8. import fr.adQ_Q.commands.Command;
  9. import fr.adQ_Q.listener.Events;
  10.  
  11. public class Main extends JavaPlugin {
  12.  
  13.     public void onEnable() {
  14.         getCommand("hub").setExecutor(new Command());
  15.         getServer().getPluginManager().registerEvents(new Events(), this);
  16.         saveDefaultConfig();
  17.         getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
  18.         getLogger().info("//-Plugin enabled" + getDescription().getVersion() + ", created by adQ_Q");
  19.     }
  20.    
  21.     public static void sendPlayer(Player player, String serverInString) {
  22.         ByteArrayDataOutput dataOutput = ByteStreams.newDataOutput();
  23.         dataOutput.writeUTF("Connect");
  24.         dataOutput.writeUTF("PlayerCount");
  25.         dataOutput.writeUTF(serverInString);
  26.         player.sendPluginMessage(getPlugin(), "BungeeCord", dataOutput.toByteArray());
  27.     }
  28.    
  29.     public static Plugin getPlugin() {
  30.         return getPlugin(Main.class);
  31.     }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement