Render command now responds with a nice message.
This commit is contained in:
parent
93ac01c56d
commit
02514b8625
2 changed files with 7 additions and 3 deletions
|
|
@ -292,7 +292,8 @@ public class DynmapPlugin extends JavaPlugin {
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
if (args[0].equals("render")) {
|
if (args[0].equals("render")) {
|
||||||
if (sender instanceof Player) {
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
} else if (args[0].equals("hide")) {
|
} else if (args[0].equals("hide")) {
|
||||||
|
|
|
||||||
|
|
@ -161,16 +161,19 @@ public class MapManager {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void touch(Location l) {
|
public int touch(Location l) {
|
||||||
DynmapWorld world = worlds.get(l.getWorld().getName());
|
DynmapWorld world = worlds.get(l.getWorld().getName());
|
||||||
if (world == null)
|
if (world == null)
|
||||||
return;
|
return 0;
|
||||||
|
int invalidates = 0;
|
||||||
for (int i = 0; i < world.maps.size(); i++) {
|
for (int i = 0; i < world.maps.size(); i++) {
|
||||||
MapTile[] tiles = world.maps.get(i).getTiles(l);
|
MapTile[] tiles = world.maps.get(i).getTiles(l);
|
||||||
for (int j = 0; j < tiles.length; j++) {
|
for (int j = 0; j < tiles.length; j++) {
|
||||||
invalidateTile(tiles[j]);
|
invalidateTile(tiles[j]);
|
||||||
|
invalidates++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return invalidates;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void invalidateTile(MapTile tile) {
|
public void invalidateTile(MapTile tile) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue