mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 19:25:15 +01:00
Add API for other plugins to trigger map renders due to updated volumes
This commit is contained in:
parent
36d8a701e0
commit
3455a8a3d4
@ -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…
Reference in New Issue
Block a user