Advertisement
Guest User

Main

a guest
Sep 3rd, 2015
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. public class Essentials extends JavaPlugin {
  2. private final Logger logger = Logger.getLogger("Minecraft");
  3. public static Essentials plugin;
  4. private Settings settings = Settings.getInstance();
  5.  
  6. @Override
  7. public void onDisable() {
  8. PluginDescriptionFile file = this.getDescription();
  9. logger.info(file.getName() + " is now disabled.");
  10. }
  11.  
  12. @Override
  13. public void onEnable() {
  14. PluginDescriptionFile file = this.getDescription();
  15. logger.info(file.getName() + " is now enabled.");
  16.  
  17. getCommand("staffchat").setExecutor(new StaffChat());
  18. getCommand("kick").setExecutor(new KickCommand());
  19. getCommand("info").setExecutor(new InfoCommand());
  20.  
  21. getServer().getPluginManager().registerEvents(new PlayerListeners(), this);
  22.  
  23. plugin = this;
  24. settings.setup(this);
  25. }
  26.  
  27. public static String getName(String uuid) {
  28. String name;
  29.  
  30. try {
  31. name = new NameFetcher(Arrays.asList(UUID.fromString(uuid))).call().get(UUID.fromString(uuid));
  32. } catch (Exception e) {
  33. e.printStackTrace();
  34. return null;
  35. }
  36. return name;
  37. }
  38.  
  39. public static String getUUID(Player player) {
  40. String uuid;
  41. try {
  42. uuid = new UUIDFetcher(Arrays.asList(player.getName())).call().get(player.getName()).toString();
  43. } catch (Exception e) {
  44. e.printStackTrace();
  45. return null;
  46. }
  47. return uuid;
  48. }
  49.  
  50. public static String getUUID(OfflinePlayer player) {
  51. String uuid;
  52. try {
  53. uuid = new UUIDFetcher(Arrays.asList(player.getName())).call().get(player.getName()).toString();
  54. } catch (Exception e) {
  55. e.printStackTrace();
  56. return null;
  57. }
  58. return uuid;
  59. }
  60.  
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement