Add API for other plugins to trigger map renders due to updated volumes
This commit is contained in:
parent
8b18c9f011
commit
2471ac249f
2 changed files with 28 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
package org.dynmap;
|
package org.dynmap;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
import org.dynmap.markers.MarkerAPI;
|
import org.dynmap.markers.MarkerAPI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -29,4 +30,13 @@ public interface DynmapAPI {
|
||||||
* @param msg - message to be sent
|
* @param msg - message to be sent
|
||||||
*/
|
*/
|
||||||
public boolean sendBroadcastToWeb(String sender, String msg);
|
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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1306,6 +1306,24 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||||
}
|
}
|
||||||
return false;
|
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
|
* Register markers API - used by component to supply marker API to plugin
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue