当前位置: 首页>>代码示例>>Java>>正文


Java MarkerAPI类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:19,代码来源:TempMarker.java

示例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;
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:21,代码来源:TempMarkerSet.java

示例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);
}
 
开发者ID:TBMCPlugins,项目名称:ButtonChat,代码行数:34,代码来源:DTBridge.java

示例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]);
		}
	}	
	
}
 
开发者ID:StarQuestMinecraft,项目名称:StarQuestCode,代码行数:25,代码来源:SQOrbitsPlanetMover.java

示例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;
}
 
开发者ID:Ribesg,项目名称:NPlugins,代码行数:17,代码来源:DynmapBridge.java

示例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;
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:13,代码来源:TempMarker.java

示例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;
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:8,代码来源:TempMarker.java

示例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;
}
 
开发者ID:netizen539,项目名称:civcraft,代码行数:8,代码来源:CivCraftUpdateTask.java

示例9: getMarkerAPI

import org.dynmap.markers.MarkerAPI; //导入依赖的package包/类
@Override
public MarkerAPI getMarkerAPI() {
    if (commonapi == null)
        return null;
    else
        return commonapi.getMarkerAPI();
}
 
开发者ID:webbukkit,项目名称:DynmapCBBridge,代码行数:8,代码来源:DynmapCBBridgePlugin.java

示例10: getMarkerAPI

import org.dynmap.markers.MarkerAPI; //导入依赖的package包/类
@Override
public final MarkerAPI getMarkerAPI() {
    return core.getMarkerAPI();
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:5,代码来源:DynmapPlugin.java

示例11: getMarkerAPI

import org.dynmap.markers.MarkerAPI; //导入依赖的package包/类
public MarkerAPI getMarkerAPI() {
    return core.getMarkerAPI();
}
 
开发者ID:UnoModding,项目名称:cynmap,代码行数:4,代码来源:CynmapPlugin.java

示例12: BukkitMCDynmapMarkerAPI

import org.dynmap.markers.MarkerAPI; //导入依赖的package包/类
public BukkitMCDynmapMarkerAPI(MarkerAPI dynmapMarkerAPI) {
	_api = dynmapMarkerAPI;
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:4,代码来源:BukkitMCDynmapMarkerAPI.java

示例13: getHandle

import org.dynmap.markers.MarkerAPI; //导入依赖的package包/类
@Override
public MarkerAPI getHandle() {
	return _api;
}
 
开发者ID:Hekta,项目名称:CHDynmap,代码行数:5,代码来源:BukkitMCDynmapMarkerAPI.java


注:本文中的org.dynmap.markers.MarkerAPI类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。