public static void updateMarker(Spawn point) { Marker m = set.findMarker(point.getName()); if (m != null) { if (m.getX() != point.getX() || m.getY() != point.getY() || m.getZ() != point.getZ()) { m.setLocation(point.getWorldName(), point.getX(), point.getY(), point.getZ()); } } set.createMarker( point.getName(), point.getName(), point.getWorldName(), point.getX(), point.getY(), point.getZ(), icon, true); }
public ReaperMarkers(FearTheReaper plugin, DynmapAPI dm) { // Setup the API api = dm; mApi = api.getMarkerAPI(); if (mApi == null) { return; } icon = mApi.getMarkerIcon("tomb"); if (icon == null) { InputStream in = getClass().getResourceAsStream("/tomb.png"); icon = mApi.createMarkerIcon("tomb", "Graveyards", in); } set = mApi.getMarkerSet("graveyard.markerset"); if (set == null) { set = mApi.createMarkerSet("graveyard.markerset", "Graveyards", null, true); set.setLayerPriority(10); set.setHideByDefault(false); set.setMinZoom(0); } for (Entry<String, Spawn> entry : FearTheReaper.getSpawnList().entrySet()) { Marker m = set.findMarker(entry.getKey()); Spawn s = entry.getValue(); if (m != null) { if (m.getX() != s.getX() || m.getY() != s.getY() || m.getZ() != s.getZ()) { m.setLocation(s.getWorldName(), s.getX(), s.getY(), s.getZ()); } } set.createMarker( entry.getKey(), entry.getKey(), s.getWorldName(), s.getX(), s.getY(), s.getZ(), icon, true); } }