diff --git a/src/main/java/org/dynmap/DynmapAPI.java b/src/main/java/org/dynmap/DynmapAPI.java index e884a05a..2c9f4cb6 100644 --- a/src/main/java/org/dynmap/DynmapAPI.java +++ b/src/main/java/org/dynmap/DynmapAPI.java @@ -1,5 +1,6 @@ package org.dynmap; +import org.bukkit.Location; import org.dynmap.markers.MarkerAPI; /** @@ -29,4 +30,13 @@ public interface DynmapAPI { * @param msg - message to be sent */ public boolean sendBroadcastToWeb(String sender, String msg); + /** + * Trigger update on tiles associated with given locations. If two locations provided, + * the volume is the rectangular prism ("cuboid") with the two locations on opposite corners. + * + * @param l0 - first location (required) + * @param l1 - second location (if null, only single point invalidated (l0)) + * @return number of tiles queued to be rerendered + */ + public int triggerRenderOfVolume(Location l0, Location l1); } diff --git a/src/main/java/org/dynmap/DynmapPlugin.java b/src/main/java/org/dynmap/DynmapPlugin.java index 4bce7b1d..d6c6d897 100644 --- a/src/main/java/org/dynmap/DynmapPlugin.java +++ b/src/main/java/org/dynmap/DynmapPlugin.java @@ -1306,6 +1306,24 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI { } return false; } + /** + * Trigger update on tiles associated with given locations. If two locations provided, + * the volume is the rectangular prism ("cuboid") with the two locations on opposite corners. + * + * @param l0 - first location (required) + * @param l1 - second location (if null, only single point invalidated (l0)) + * @return number of tiles queued to be rerendered + */ + public int triggerRenderOfVolume(Location l0, Location l1) { + if(mapManager != null) { + if(l1 == null) + return mapManager.touch(l0); + else + return mapManager.touchVolume(l0, l1); + } + return 0; + } + /** * Register markers API - used by component to supply marker API to plugin */