本文整理汇总了Java中org.bukkit.map.MapView.removeRenderer方法的典型用法代码示例。如果您正苦于以下问题:Java MapView.removeRenderer方法的具体用法?Java MapView.removeRenderer怎么用?Java MapView.removeRenderer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.map.MapView
的用法示例。
在下文中一共展示了MapView.removeRenderer方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMapView
import org.bukkit.map.MapView; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
protected MapView getMapView() {
if (!enabled) {
return null;
}
MapView mapView = Bukkit.getMap(id);
if (mapView == null) {
enabled = false;
controller.warning("Failed to get map id " + id + " for key " + getKey() + ", disabled, use 'mmap fix' to re-enable");
return null;
}
List<MapRenderer> renderers = mapView.getRenderers();
boolean needsRenderer = false;
for (MapRenderer renderer : renderers) {
if (!(renderer instanceof URLMap)) {
mapView.removeRenderer(renderer);
needsRenderer = true;
}
}
if (needsRenderer) {
mapView.addRenderer(this);
}
return mapView;
}
示例2: deleteMap
import org.bukkit.map.MapView; //导入方法依赖的package包/类
/**
* Delete image map
* @param mapView map view to remove map
*/
public void deleteMap(MapView mapView) {
short mapId = mapView.getId();
List<MapRenderer> renderers = mapView.getRenderers();
File fileName = new File(ConfigProvider.getImgFolder(), mapId + ".png");
if (fileName.exists()) {
fileName.delete();
}
for (MapRenderer r : renderers) {
mapView.removeRenderer(r);
}
synchronized (m_mapList) {
Integer key = (int) mapId;
if (!m_mapList.containsKey(key)) {
return;
}
renderers = m_mapList.get(key);
for (MapRenderer mapRenderer : renderers) {
mapView.addRenderer(mapRenderer);
}
m_mapList.remove(key);
}
}
示例3: storeMap
import org.bukkit.map.MapView; //导入方法依赖的package包/类
/**
* Store map image on disk
* @param mapView map to store
* @param img current map image
*/
public void storeMap(MapView mapView, BufferedImage img) {
List<MapRenderer> renderers = mapView.getRenderers();
short mapId = mapView.getId();
for (MapRenderer r : renderers) {
mapView.removeRenderer(r);
}
synchronized (m_mapList) {
Integer key = (int) mapId;
if (!m_mapList.containsKey(key)) {
m_mapList.put(key, renderers);
}
}
File fileName = new File(ConfigProvider.getImgFolder(), mapId + ".png");
try {
ImageIO.write(img, "png", fileName);
} catch (IOException ex) {
ExceptionHelper.printException(ex, "Error storing map image.");
}
}
示例4: createHandler
import org.bukkit.map.MapView; //导入方法依赖的package包/类
public static void createHandler(MapView mapView, boolean overwrite) {
if (mapView != null) {
if (overwrite && mapView.getRenderers() != null) {
for (MapRenderer renderer : mapView.getRenderers()) {
mapView.removeRenderer(renderer);
}
}
mapView.addRenderer(new SkellettMapRenderer());
}
}
示例5: removeMapRenderers
import org.bukkit.map.MapView; //导入方法依赖的package包/类
/**
* Removed Beaconz renderers from maps when the plugin is disabled
*/
public void removeMapRenderers() {
for (Short id : beaconMaps.keySet()) {
MapView map = Bukkit.getMap(id);
if (map != null) {
for (MapRenderer renderer : map.getRenderers()) {
if (renderer instanceof TerritoryMapRenderer || renderer instanceof BeaconMap) {
map.removeRenderer(renderer);
}
}
}
}
}
示例6: changeToSwuMap
import org.bukkit.map.MapView; //导入方法依赖的package包/类
/**
* Changes the given MapView to render a ChunkInfo map.
*
* Removes any other renderer from the MapView and adds the
* ChunkInfoRenderer as the only new one.
*
* @param map
* The MapView to change.
*/
public void changeToSwuMap(MapView map) {
if (map.isVirtual())
return;
for (MapRenderer renderer : map.getRenderers()) {
map.removeRenderer(renderer);
}
map.addRenderer(mapRenderer);
}
示例7: applyToMap
import org.bukkit.map.MapView; //导入方法依赖的package包/类
static MapView applyToMap(MapView map, BufferedImage image) {
for (MapRenderer renderer : map.getRenderers())
map.removeRenderer(renderer);
map.addRenderer(new ImageRenderer(image));
return map;
}
示例8: set
import org.bukkit.map.MapView; //导入方法依赖的package包/类
public void set(MapView mw)
{
for (MapRenderer mr : mw.getRenderers())
mw.removeRenderer(mr);
mw.addRenderer(this);
}
示例9: removeAllRenderers
import org.bukkit.map.MapView; //导入方法依赖的package包/类
public static void removeAllRenderers(MapView map) {
for (int i = 0; i < map.getRenderers().size(); i++) {
map.removeRenderer(map.getRenderers().get(i));
}
}
示例10: regenerate
import org.bukkit.map.MapView; //导入方法依赖的package包/类
/**
* Resets an existing game
* The idea is that all current beacons will be removed
* and the region will regenerate "fresh"
* @param sender
*/
public void regenerate(CommandSender sender) {
// Set restart flag as true
gameRestart = true;
// Move all players in game to lobby
for (Player player : getServer().getOnlinePlayers()) {
if (getRegion().isPlayerInRegion(player)) {
// Clear inventories
player.getInventory().clear();
sendToLobby(player);
}
}
// Delete the teams
scorecard.deleteTeamMembers();
// Handle maps
Iterator<Short> it = getRegister().getBeaconMapIndex().iterator();
while (it.hasNext()) {
short index = it.next();
MapView map = Bukkit.getMap(index);
if (map != null && (map.getWorld().equals(getBeaconzWorld()) && getRegion().containsPoint(map.getCenterX(), map.getCenterZ()))) {
for (MapRenderer renderer : map.getRenderers()) {
if (renderer instanceof TerritoryMapRenderer || renderer instanceof BeaconMap) {
map.removeRenderer(renderer);
}
}
it.remove();
}
}
// set all beacons to "unowned"
for (BeaconObj beacon : getRegister().getBeaconRegister().values()) {
if (this.getRegion().containsBeacon(beacon)) {
getRegister().removeBeaconOwnership(beacon, true);
}
}
getRegister().saveRegister();
region.regenerate(sender, "");
startTime = ((System.currentTimeMillis()+500)/1000)*1000;
scorecard.reload();
getBeaconzStore().removeGame(gameName);
save();
// Set restart flag as true
gameRestart = false;
// It's not over
isOver = false;
}
示例11: clearRender
import org.bukkit.map.MapView; //导入方法依赖的package包/类
public void clearRender(MapView view) {
for (MapRenderer render : view.getRenderers()) view.removeRenderer(render);
}
示例12: applyToMap
import org.bukkit.map.MapView; //导入方法依赖的package包/类
public void applyToMap(MapView map) {
for (MapRenderer renderer : map.getRenderers()) {
map.removeRenderer(renderer);
}
map.addRenderer(this);
}