Location targetLocation = new Location("");//provider name is unecessary targetLocation.setLatitude(0.0d);//your coords of course targetLocation.setLongitude(0.0d); float distanceInMeters = targetLocation.distanceTo(myLocation);
Location location = new Location(""); location.setLatitude(lat); location.setLongitude(lon);
/** * Returns if this note is sharped. * * @return if this note is sharped. */ public boolean isSharped() { byte note = getToneByte(); return Tone.getById(note).isSharped(note); }
@Override public boolean isActive() { // This is a thread safe call on CraftBukkit because it uses a // CopyOnWrite list for the list of players, but the Bukkit // specification doesn't require thread safety (though the // spec is extremely incomplete) return Bukkit.getServer().getPlayer(uuid) != null; }
/** * @see Server#getServicesManager() */ public static ServicesManager getServicesManager() { return server.getServicesManager(); }
/** * @see Server#getMaxPlayers() */ public static int getMaxPlayers() { return server.getMaxPlayers(); }
/** * @see Server#getScoreboardManager() */ public static ScoreboardManager getScoreboardManager() { return server.getScoreboardManager(); }
/** * @see Server#unloadWorld(World world, boolean save) */ public static boolean unloadWorld(World world, boolean save) { return server.unloadWorld(world, save); }
/** * @see Server#getUpdateFolder() */ public static String getUpdateFolder() { return server.getUpdateFolder(); }
/** * @see Server#getRecipesFor(ItemStack result) */ public static List<Recipe> getRecipesFor(ItemStack result) { return server.getRecipesFor(result); }
/** * @see Server#isPrimaryThread() */ public static boolean isPrimaryThread() { return server.isPrimaryThread(); }
/** * Returns the tone of this note. * * @return the tone of this note. */ public Tone getTone() { return Tone.getById(getToneByte()); }
/** * @see Server#getServerId() */ public static String getServerId() { return server.getServerId(); }
/** * @see Server#getWorldType() */ public static String getWorldType() { return server.getWorldType(); }
Location locationA = new Location("point A"); locationA.setLatitude(latA); locationA.setLongitude(lngA); Location locationB = new Location("point B"); locationB.setLatitude(latB); locationB.setLongitude(lngB); float distance = locationA.distanceTo(locationB);
@Override public boolean includes(Material item) { return item.equals(Material.FISHING_ROD); } };
Location loc1 = new Location(""); loc1.setLatitude(lat1); loc1.setLongitude(lon1); Location loc2 = new Location(""); loc2.setLatitude(lat2); loc2.setLongitude(lon2); float distanceInMeters = loc1.distanceTo(loc2);