diff --git a/src/main/java/org/dynmap/DynmapPlugin.java b/src/main/java/org/dynmap/DynmapPlugin.java index c56502fc..2413be87 100644 --- a/src/main/java/org/dynmap/DynmapPlugin.java +++ b/src/main/java/org/dynmap/DynmapPlugin.java @@ -217,7 +217,7 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI { if (permissions == null) permissions = BukkitPermissions.create("dynmap"); if (permissions == null) - permissions = new OpPermissions(new String[] { "fullrender", "cancelrender", "radiusrender", "resetstats", "reload" }); + permissions = new OpPermissions(new String[] { "fullrender", "cancelrender", "radiusrender", "resetstats", "reload", "purgequeue" }); dataDirectory = this.getDataFolder(); @@ -724,7 +724,8 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI { "reload", "stats", "resetstats", - "sendtoweb" })); + "sendtoweb", + "purgequeue" })); @Override public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) { @@ -846,6 +847,8 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI { } else { sender.sendMessage("World name is required"); } + } else if (c.equals("purgequeue") && checkPlayerPermission(sender, "purgequeue")) { + mapManager.purgeQueue(sender); } else if (c.equals("reload") && checkPlayerPermission(sender, "reload")) { sender.sendMessage("Reloading Dynmap..."); reload(); diff --git a/src/main/java/org/dynmap/MapManager.java b/src/main/java/org/dynmap/MapManager.java index 47468e3d..6ece378f 100644 --- a/src/main/java/org/dynmap/MapManager.java +++ b/src/main/java/org/dynmap/MapManager.java @@ -724,6 +724,18 @@ public class MapManager { } } + void purgeQueue(CommandSender sender) { + if(tileQueue != null) { + int cnt = 0; + List popped = tileQueue.popAll(); + if(popped != null) { + cnt = popped.size(); + popped.clear(); + } + sender.sendMessage("Purged " + cnt + " tiles from queue"); + } + } + public void activateWorld(World w) { ConfigurationNode worldConfiguration = plug_in.getWorldConfiguration(w); if (!worldConfiguration.getBoolean("enabled", false)) { diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 8f5f8340..3bbeb4ad 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -24,6 +24,7 @@ commands: / resetstats - Reset render statistics. / resetstats world - Reset render statistics for maps on world 'world'. / sendtoweb msg - Send message to web users + / purgequeue - Set tile update queue to empty dmarker: description: Manipulate map markers @@ -77,6 +78,7 @@ permissions: dynmap.stats: true dynmap.resetstats: true dynmap.sendtoweb: true + dynmap.purgequeue: true dynmap.marker.add: true dynmap.marker.update: true dynmap.marker.movehere: true @@ -131,6 +133,9 @@ permissions: dynmap.sendtoweb: description: Allows /dynmap sendtoweb default: op + dynmap.purgequeue: + description: Allows /dynmap purgequeue + default: op dynmap.marker.add: description: Allows /dmarker add default: op