Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.google.common.io.ByteArrayDataInput;
- import com.google.common.io.ByteStreams;
- import org.bukkit.Bukkit;
- import org.bukkit.entity.Player;
- import org.bukkit.plugin.messaging.PluginMessageListener;
- /**
- * Created by Vinetos on 16/01/2016.
- */
- public class PluginListener implements PluginMessageListener{
- @Override
- public void onPluginMessageReceived(String s, Player p, byte[] bytes) {
- //UUID, p,
- if(!s.equalsIgnoreCase("BungeeCord"))return;
- ByteArrayDataInput in = ByteStreams.newDataInput(bytes);
- String subchannel = in.readUTF();
- if(subchannel.equalsIgnoreCase("UUID")){
- Bukkit.broadcastMessage("Player: " + p.getName() + " UUID: " + in.readUTF());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment