private static DemigodsCharacter obeliskGetCharacter(String type, final String name) { if ("character".equalsIgnoreCase(type)) return Demigods.getServer().getCharacter(name); if (!"player".equalsIgnoreCase(type)) return null; try { return DemigodsPlayer.getFromName(name).getCharacter(); } catch (Exception ignored) { // ignored } return null; }
private static boolean test1(CommandSender sender, final String[] args) { final Player player = (Player) sender; final UUID id = DemigodsPlayer.of(player).getMojangAccount(); Bukkit.getScheduler() .scheduleAsyncDelayedTask( DemigodsPlugin.getInst(), new Runnable() { @Override public void run() { OfflinePlayer offline = Bukkit.getServer().getOfflinePlayer(id); player.sendMessage(offline.isOnline() ? "Success!" : "Failure."); } }); return true; }