Advertisement
Evyatar12

BungeeCord_Listener.java

Apr 1st, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. package com.evyatar.bungeecord.information;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.entity.Player;
  5. import org.bukkit.plugin.messaging.PluginMessageListener;
  6.  
  7. import com.evyatar.bungeecord.Main;
  8. import com.evyatar.bungeecord.OnDataRecievedEvent;
  9. import com.google.common.io.ByteArrayDataInput;
  10. import com.google.common.io.ByteStreams;
  11.  
  12. public class BungeeCord_Listener implements PluginMessageListener {
  13.  
  14.     @Override
  15.     public void onPluginMessageReceived(String channel, Player sender, byte[] message) {
  16.         if (!channel.equals(Main.BUNGEECORD_CHANNEL)) {
  17.             return;
  18.         }
  19.        
  20.        
  21.         ByteArrayDataInput input = ByteStreams.newDataInput(message);
  22.         Bukkit.getServer().getPluginManager().callEvent(new OnDataRecievedEvent(channel, input, sender));
  23.     }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement