Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Essentials extends JavaPlugin {
- private final Logger logger = Logger.getLogger("Minecraft");
- public static Essentials plugin;
- private Settings settings = Settings.getInstance();
- @Override
- public void onDisable() {
- PluginDescriptionFile file = this.getDescription();
- logger.info(file.getName() + " is now disabled.");
- }
- @Override
- public void onEnable() {
- PluginDescriptionFile file = this.getDescription();
- logger.info(file.getName() + " is now enabled.");
- getCommand("staffchat").setExecutor(new StaffChat());
- getCommand("kick").setExecutor(new KickCommand());
- getCommand("info").setExecutor(new InfoCommand());
- getServer().getPluginManager().registerEvents(new PlayerListeners(), this);
- plugin = this;
- settings.setup(this);
- }
- public static String getName(String uuid) {
- String name;
- try {
- name = new NameFetcher(Arrays.asList(UUID.fromString(uuid))).call().get(UUID.fromString(uuid));
- } catch (Exception e) {
- e.printStackTrace();
- return null;
- }
- return name;
- }
- public static String getUUID(Player player) {
- String uuid;
- try {
- uuid = new UUIDFetcher(Arrays.asList(player.getName())).call().get(player.getName()).toString();
- } catch (Exception e) {
- e.printStackTrace();
- return null;
- }
- return uuid;
- }
- public static String getUUID(OfflinePlayer player) {
- String uuid;
- try {
- uuid = new UUIDFetcher(Arrays.asList(player.getName())).call().get(player.getName()).toString();
- } catch (Exception e) {
- e.printStackTrace();
- return null;
- }
- return uuid;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement