From cbe562d33d48af210e31f217de6af61016e573b8 Mon Sep 17 00:00:00 2001 From: FrozenCow Date: Thu, 10 Mar 2011 22:59:03 +0100 Subject: [PATCH] Render command now responds with a nice message. --- src/main/java/org/dynmap/DynmapPlugin.java | 3 ++- src/main/java/org/dynmap/MapManager.java | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/dynmap/DynmapPlugin.java b/src/main/java/org/dynmap/DynmapPlugin.java index f63085b8..78cd05fd 100644 --- a/src/main/java/org/dynmap/DynmapPlugin.java +++ b/src/main/java/org/dynmap/DynmapPlugin.java @@ -292,7 +292,8 @@ public class DynmapPlugin extends JavaPlugin { if (args.length > 0) { if (args[0].equals("render")) { if (sender instanceof Player) { - mapManager.touch(((Player) sender).getLocation()); + int invalidates = mapManager.touch(((Player) sender).getLocation()); + sender.sendMessage("Queued " + invalidates + " tiles" + (invalidates == 0 ? " (world is not loaded?)" : "...")); return true; } } else if (args[0].equals("hide")) { diff --git a/src/main/java/org/dynmap/MapManager.java b/src/main/java/org/dynmap/MapManager.java index 936546e4..8e345366 100644 --- a/src/main/java/org/dynmap/MapManager.java +++ b/src/main/java/org/dynmap/MapManager.java @@ -161,16 +161,19 @@ public class MapManager { return result; } - public void touch(Location l) { + public int touch(Location l) { DynmapWorld world = worlds.get(l.getWorld().getName()); if (world == null) - return; + return 0; + int invalidates = 0; for (int i = 0; i < world.maps.size(); i++) { MapTile[] tiles = world.maps.get(i).getTiles(l); for (int j = 0; j < tiles.length; j++) { invalidateTile(tiles[j]); + invalidates++; } } + return invalidates; } public void invalidateTile(MapTile tile) {