Vinetos

Bukkit NMS | Écoute de Packets (#03) - Main.java

Nov 11th, 2015
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. import com.comphenix.protocol.ProtocolLibrary;
  2. import com.comphenix.protocol.ProtocolManager;
  3. import org.bukkit.plugin.Plugin;
  4. import org.bukkit.plugin.java.JavaPlugin;
  5.  
  6. /**
  7. * @author VINETOS on 08/11/2015.
  8. */
  9. public class Main extends JavaPlugin {
  10.  
  11. private static Plugin pl;
  12. private static ProtocolManager protocolManager;
  13.  
  14. @Override
  15. public void onEnable() {
  16. pl = this;
  17. if(getServer().getPluginManager().getPlugin("ProtocolLib") == null){
  18. /*Il n'y a pas la dépendance*/
  19. getServer().getPluginManager().disablePlugin(this);
  20. }
  21.  
  22. protocolManager = ProtocolLibrary.getProtocolManager();
  23. Listener.listenChatPackets();
  24.  
  25. }
  26.  
  27. public static Plugin getInstance(){
  28. return pl;
  29. }
  30.  
  31. public static ProtocolManager getprotocolManager(){
  32. return protocolManager;
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment