本文整理汇总了Java中org.dynmap.markers.MarkerAPI类的典型用法代码示例。如果您正苦于以下问题:Java MarkerAPI类的具体用法?Java MarkerAPI怎么用?Java MarkerAPI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MarkerAPI类属于org.dynmap.markers包,在下文中一共展示了MarkerAPI类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import org.dynmap.markers.MarkerAPI; //导入依赖的package包/类
public void update(MarkerAPI markerApi, Marker marker) {
if (!this.world.equals(marker.getWorld()) || this.x != marker.getX() || this.y != marker.getY() || this.z != marker.getZ()) {
marker.setLocation(this.world, this.x, this.y, this.z);
}
if (!marker.getLabel().equals(this.label)) {
marker.setLabel(this.label);
}
MarkerIcon icon = getMarkerIcon(markerApi, this.iconName);
if (marker.getMarkerIcon() == null || marker.getMarkerIcon().equals(icon)) {
marker.setMarkerIcon(icon);
}
if (!marker.getDescription().equals(this.description)) {
marker.setDescription(this.description);
}
}
示例2: create
import org.dynmap.markers.MarkerAPI; //导入依赖的package包/类
public MarkerSet create(MarkerAPI markerApi, String id) {
MarkerSet ret = markerApi.createMarkerSet(id, this.label, null, false); // ("null, false" at the end means "all icons allowed, not perisistent")
if (ret == null) {
return null;
}
// Minimum Zoom
if (this.minimumZoom > 0) {
ret.setMinZoom(this.minimumZoom);
}
// Priority
ret.setLayerPriority(this.priority);
// Hide by Default
ret.setHideByDefault(this.hideByDefault);
return ret;
}
示例3: setTownColor
import org.dynmap.markers.MarkerAPI; //导入依赖的package包/类
/**
* Sets the town color on Dynmap.
*
* @param dtp
* The Dynmap-Towny plugin
* @param townname
* The name of the town
* @param strokecolor
* The stroke color in RGB format
* @param fillcolor
* The fill color in RGB format
* @throws Exception
* When couldn't set the town color
*/
public static void setTownColor(DynmapTownyPlugin dtp, String townname, int strokecolor, int fillcolor)
throws ClassNotFoundException, NoSuchFieldException, SecurityException, IllegalArgumentException, // Keeping these because why not
IllegalAccessException, NoSuchMethodException, InstantiationException, InvocationTargetException {
Class<?> cl = Class.forName(DynmapTownyPlugin.class.getName() + "$AreaStyle");
Field field = DynmapTownyPlugin.class.getDeclaredField("cusstyle");
field.setAccessible(true); // DOesn't allow accessing it from the same package, if it's from a different plugin
@SuppressWarnings("unchecked")
val map = (Map<String, Object>) field.get(dtp);
Object style = map.get(townname);
if (style == null) {
Constructor<?> c = cl.getDeclaredConstructor(FileConfiguration.class, String.class, MarkerAPI.class);
c.setAccessible(true);
style = c.newInstance(dtp.getConfig(), "custstyle" + townname,
((DynmapPlugin) Bukkit.getPluginManager().getPlugin("dynmap")).getMarkerAPI());
map.put(townname, style);
}
set(cl, style, "fillcolor", fillcolor);
set(cl, style, "strokecolor", strokecolor);
}
示例4: updateDynmap
import org.dynmap.markers.MarkerAPI; //导入依赖的package包/类
private void updateDynmap() {
Plugin dynmapPlugin = Bukkit.getServer().getPluginManager().getPlugin("dynmap");
if (dynmapPlugin == null || !(dynmapPlugin instanceof DynmapAPI)){
print("Critical error accessing the dynmap plugin, dynmap will not be used.");
return;
} //dynmap contract assumes none of the below null
DynmapAPI dynmapAPI = (DynmapAPI)dynmapPlugin;
MarkerAPI markerAPI = dynmapAPI.getMarkerAPI();
MarkerIcon planetIcon = markerAPI.getMarkerIcon("world");
MarkerSet markers = markerAPI.getMarkerSet("markers");
for (String name : centreCoordinates.keySet()){
Integer[] coords = centreCoordinates.get(name);
Marker planetMarker = markers.findMarker(name);
if (planetMarker == null){
markers.createMarker(name, name, worldName, coords[0], coords[1], coords[2], planetIcon,true);
} else {
planetMarker.setLocation(worldName, coords[0], coords[1], coords[2]);
}
}
}
示例5: DynmapBridge
import org.dynmap.markers.MarkerAPI; //导入依赖的package包/类
public DynmapBridge() {
MarkerSet markerSet = null;
if (Dynmap.init()) {
final DynmapCommonAPI api = Dynmap.getApi();
final MarkerAPI markerApi = api.getMarkerAPI();
markerSet = markerApi.getMarkerSet(MARKERSET_ID);
if (markerSet == null) {
markerSet = markerApi.createMarkerSet(MARKERSET_ID, MARKERSET_NAME, null, false);
}
if (markerSet == null) {
LOGGER.warning("Failed to initialize DynmapBridge!");
}
}
this.markerSet = markerSet;
this.initialized = false;
}
示例6: create
import org.dynmap.markers.MarkerAPI; //导入依赖的package包/类
public Marker create(MarkerAPI markerApi, MarkerSet markerset, String markerId) {
Marker ret = markerset.createMarker(markerId, this.label, this.world, this.x, this.y, this.z, getMarkerIcon(markerApi, this.iconName), false // not persistent
);
if (ret == null) {
return null;
}
ret.setDescription(this.description);
return ret;
}
示例7: getMarkerIcon
import org.dynmap.markers.MarkerAPI; //导入依赖的package包/类
public static MarkerIcon getMarkerIcon(MarkerAPI markerApi, String name) {
MarkerIcon ret = markerApi.getMarkerIcon(name);
if (ret == null) {
ret = markerApi.getMarkerIcon(DynmapStyle.DEFAULT_HOME_MARKER);
}
return ret;
}
示例8: CivCraftUpdateTask
import org.dynmap.markers.MarkerAPI; //导入依赖的package包/类
public CivCraftUpdateTask(DynmapAPI api, MarkerAPI markerapi, MarkerSet townset, MarkerSet cultureset, MarkerSet structureSet) {
this.api = api;
this.markerapi = markerapi;
this.townBorderSet = townset;
this.cultureSet = cultureset;
this.structureSet = structureSet;
}
示例9: getMarkerAPI
import org.dynmap.markers.MarkerAPI; //导入依赖的package包/类
@Override
public MarkerAPI getMarkerAPI() {
if (commonapi == null)
return null;
else
return commonapi.getMarkerAPI();
}
示例10: getMarkerAPI
import org.dynmap.markers.MarkerAPI; //导入依赖的package包/类
@Override
public final MarkerAPI getMarkerAPI() {
return core.getMarkerAPI();
}
示例11: getMarkerAPI
import org.dynmap.markers.MarkerAPI; //导入依赖的package包/类
public MarkerAPI getMarkerAPI() {
return core.getMarkerAPI();
}
示例12: BukkitMCDynmapMarkerAPI
import org.dynmap.markers.MarkerAPI; //导入依赖的package包/类
public BukkitMCDynmapMarkerAPI(MarkerAPI dynmapMarkerAPI) {
_api = dynmapMarkerAPI;
}
示例13: getHandle
import org.dynmap.markers.MarkerAPI; //导入依赖的package包/类
@Override
public MarkerAPI getHandle() {
return _api;
}