org.bukkit.Bukkit.createMap()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(189)

本文整理了Java中org.bukkit.Bukkit.createMap()方法的一些代码示例,展示了Bukkit.createMap()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bukkit.createMap()方法的具体详情如下:
包路径:org.bukkit.Bukkit
类名称:Bukkit
方法名:createMap

Bukkit.createMap介绍

暂无

代码示例

代码示例来源:origin: zDevelopers/ImageOnMap

static public short[] getNewMapsIds(int amount)
{
  short[] mapsIds = new short[amount];
  for(int i = 0; i < amount; i++)
  {
    mapsIds[i] = Bukkit.createMap(Bukkit.getWorlds().get(0)).getId();
  }
  return mapsIds;
}

代码示例来源:origin: games647/LagMonitor

private MapView installRenderer(Player player, GraphRenderer graphType) {
    MapView mapView = Bukkit.createMap(player.getWorld());
    mapView.getRenderers().forEach(mapView::removeRenderer);

    mapView.addRenderer(graphType);
    return mapView;
  }
}

代码示例来源:origin: elBukkit/MagicPlugin

MapView mapView = Bukkit.createMap(world);
if (mapView == null) {
  if (url == null) {

代码示例来源:origin: elBukkit/MagicPlugin

@SuppressWarnings("deprecation")
@Override
public boolean fix(World world, int maxIds) {
  if (enabled) return true;
  MapView mapView = Bukkit.getMap(id);
  if (mapView != null) {
    enabled = true;
    return true;
  }
  int retry = 0;
  boolean matched = false;
  while (!matched && retry < maxIds) {
    MapView newView = Bukkit.createMap(world);
    short newId = newView.getId();
    matched = newId == id;
    if (newId < 0 || newId > id) break;
    retry++;
  }
  mapView = getMapView();
  if (mapView == null) {
    controller.warning("Failed to fix map id " + id + " for key " + getKey());
  } else {
    enabled = true;
  }
  return enabled;
}

代码示例来源:origin: elBukkit/MagicPlugin

@SuppressWarnings("deprecation")
  @Override
  public SpellResult onCast(ConfigurationSection parameters)
  {
    World world = getWorld();
    MapView newMap = Bukkit.createMap(world);
    Location location = getLocation();
    newMap.setCenterX(location.getBlockX());
    newMap.setCenterZ(location.getBlockZ());

    MapView.Scale scale = newMap.getScale();
    String scaleType = parameters.getString("scale");
    if (scaleType != null) {
      try {
        scale = MapView.Scale.valueOf(scaleType.toUpperCase());
      } catch (Exception ignored) {

      }
    }

    newMap.setScale(scale);

    ItemStack newMapItem = controller.getMap(newMap.getId());
    world.dropItemNaturally(getLocation(), newMapItem);
    return SpellResult.CAST;
  }
}

相关文章