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


Java BukkitUtil.getLocalWorld方法代码示例

本文整理汇总了Java中com.sk89q.worldedit.bukkit.BukkitUtil.getLocalWorld方法的典型用法代码示例。如果您正苦于以下问题:Java BukkitUtil.getLocalWorld方法的具体用法?Java BukkitUtil.getLocalWorld怎么用?Java BukkitUtil.getLocalWorld使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sk89q.worldedit.bukkit.BukkitUtil的用法示例。


在下文中一共展示了BukkitUtil.getLocalWorld方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import com.sk89q.worldedit.bukkit.BukkitUtil; //导入方法依赖的package包/类
@Override
protected boolean execute() {
    while (!regions.isEmpty()) {
        final Region region = regions.remove(0);
        LocalWorld localWorld = BukkitUtil.getLocalWorld(world);
        final EditSession editSession = WorldEditHandler.createEditSession(localWorld, region.getArea() * 255);
        editSession.enableQueue();
        editSession.setFastMode(true);
        try {
            editSession.setBlocks(region, AIR);
        } catch (MaxChangedBlocksException e) {
            log.log(Level.INFO, "Warning: we got MaxChangedBlocks from WE, please increase it!");
        }
        editSession.flushQueue();
        //editSession.commit();
        if (!tick()) {
            break;
        }
    }
    return regions.isEmpty();
}
 
开发者ID:rlf,项目名称:uSkyBlock,代码行数:22,代码来源:WorldEditClear.java

示例2: clearOldRegions

import com.sk89q.worldedit.bukkit.BukkitUtil; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
private void clearOldRegions() {
	for (String planetName : centreCoordinates.keySet()){
		ProtectedRegion wgRegion = rgMgr.getRegion(planetName);
		if(wgRegion == null){
			print("No WG region forund for planet '"+planetName+"', skipping region deletion.");
			continue;
		}
		com.sk89q.worldedit.LocalWorld weWorld = BukkitUtil.getLocalWorld(world);
		EditSession es = WorldEdit.getInstance().getEditSessionFactory().getEditSession(weWorld, -1);
		Region weRegion = new Polygonal2DRegion(weWorld,
				wgRegion.getPoints(), 
				wgRegion.getMinimumPoint().getBlockY(),
				wgRegion.getMaximumPoint().getBlockY());
		try {
			es.setBlocks(weRegion, new BaseBlock(BlockID.AIR));
		} catch (MaxChangedBlocksException e) {
			// should never happen as limit is -1
			print("Error deleting blocks with WE for planet '"+planetName+"', max block limit reached.");
		}
		rgMgr.removeRegion(planetName);
	}	
}
 
开发者ID:StarQuestMinecraft,项目名称:StarQuestCode,代码行数:24,代码来源:SQOrbitsPlanetMover.java

示例3: loadRegion

import com.sk89q.worldedit.bukkit.BukkitUtil; //导入方法依赖的package包/类
/**
 * Load a given region from a file configuration
 * 
 * @param file The file to save too
 * @param path The path in the file config
 * @return The loaded region.
 */
protected Region loadRegion(FileConfiguration file, String path) {
	LocalWorld world = BukkitUtil.getLocalWorld(this.world);
	Double minX = file.getDouble(path + ".min.x");
	Double minY = file.getDouble(path + ".min.y");
	Double minZ = file.getDouble(path + ".min.z");
	Double maxX = file.getDouble(path + ".max.x");
	Double maxY = file.getDouble(path + ".max.y");
	Double maxZ = file.getDouble(path + ".max.z");

	return new CuboidRegion(world, new com.sk89q.worldedit.Vector(minX, minY, minZ), new com.sk89q.worldedit.Vector(maxX, maxY, maxZ));
}
 
开发者ID:CodingBadgers,项目名称:MineKart,代码行数:19,代码来源:Racecourse.java

示例4: getRegion

import com.sk89q.worldedit.bukkit.BukkitUtil; //导入方法依赖的package包/类
private Region getRegion(Player player) {
    WorldEditPlugin worldEdit = getWorldEdit();
    LocalWorld world = BukkitUtil.getLocalWorld(player.getWorld());
    RegionSelector selector = worldEdit.getSession(player)
            .getRegionSelector(world);
    try {
        return selector.getRegion();
    } catch (IncompleteRegionException exc) {
        throw new WERegionIncomplete(dac);
    }
}
 
开发者ID:Loscillo,项目名称:DACv2-temp,代码行数:12,代码来源:SetWECommands.java

示例5: setSelection

import com.sk89q.worldedit.bukkit.BukkitUtil; //导入方法依赖的package包/类
private void setSelection(Player sender, Arena arena,
        WESelector selectorType, Region region) {
    WorldEditPlugin worldEdit = getWorldEdit();
    LocalWorld world = BukkitUtil.getLocalWorld(arena.getWorld());
    Shape shape = region.getShape();

    RegionSelector sel = selectorType.create(dac, world, shape);
    LocalSession session = worldEdit.getSession(sender);
    session.setRegionSelector(world, sel);
    session.dispatchCUISelection(worldEdit.wrapPlayer(sender));
}
 
开发者ID:Loscillo,项目名称:DACv2-temp,代码行数:12,代码来源:SelectCommands.java

示例6: getWorldEditLocation

import com.sk89q.worldedit.bukkit.BukkitUtil; //导入方法依赖的package包/类
/**
 * Get the world edit representation of a players location
 * 
 * @return A world edit vector representation of a players location
 */
public com.sk89q.worldedit.Vector getWorldEditLocation() {
	Location loc = player.getEyeLocation();
       return new WorldVector(BukkitUtil.getLocalWorld(loc.getWorld()), 
       		loc.getX(), loc.getY(), loc.getZ());
}
 
开发者ID:CodingBadgers,项目名称:MineKart,代码行数:11,代码来源:Jockey.java


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