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


Java Region.getChunks方法代码示例

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


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

示例1: setlighting

import com.sk89q.worldedit.regions.Region; //导入方法依赖的package包/类
@Command(
        aliases = {"/setblocklight", "/setlight"},
        desc = "Set block lighting in a selection",
        min = 1,
        max = 1
)
@CommandPermissions("worldedit.light.set")
public void setlighting(Player player, @Selection Region region, @Range(min = 0, max = 15) int value) {
    FawePlayer fp = FawePlayer.wrap(player);
    final FaweLocation loc = fp.getLocation();
    final int cx = loc.x >> 4;
    final int cz = loc.z >> 4;
    final NMSMappedFaweQueue queue = (NMSMappedFaweQueue) fp.getFaweQueue(false);
    for (Vector pt : region) {
        queue.setBlockLight((int) pt.getX(), (int) pt.getY(), (int) pt.getZ(), value);
    }
    int count = 0;
    for (Vector2D chunk : region.getChunks()) {
        queue.sendChunk(queue.getFaweChunk(chunk.getBlockX(), chunk.getBlockZ()));
        count++;
    }
    BBC.UPDATED_LIGHTING_SELECTION.send(fp, count);
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:24,代码来源:RegionCommands.java

示例2: setskylighting

import com.sk89q.worldedit.regions.Region; //导入方法依赖的package包/类
@Command(
        aliases = {"/setskylight"},
        desc = "Set sky lighting in a selection",
        min = 1,
        max = 1
)
@CommandPermissions("worldedit.light.set")
public void setskylighting(Player player, @Selection Region region, @Range(min = 0, max = 15) int value) {
    FawePlayer fp = FawePlayer.wrap(player);
    final FaweLocation loc = fp.getLocation();
    final int cx = loc.x >> 4;
    final int cz = loc.z >> 4;
    final NMSMappedFaweQueue queue = (NMSMappedFaweQueue) fp.getFaweQueue(false);
    for (Vector pt : region) {
        queue.setSkyLight((int) pt.getX(), (int) pt.getY(), (int) pt.getZ(), value);
    }
    int count = 0;
    for (Vector2D chunk : region.getChunks()) {
        queue.sendChunk(queue.getFaweChunk(chunk.getBlockX(), chunk.getBlockZ()));
        count++;
    }
    BBC.UPDATED_LIGHTING_SELECTION.send(fp, count);
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:24,代码来源:RegionCommands.java

示例3: spawnResource

import com.sk89q.worldedit.regions.Region; //导入方法依赖的package包/类
default public void spawnResource(Region region, Resource gen, int rarity, int frequency) throws WorldEditException {
    PseudoRandom random = new PseudoRandom();
    for (Vector2D chunkPos : region.getChunks()) {
        for (int i = 0; i < frequency; i++) {
            if (random.nextInt(100) > rarity) {
                continue;
            }
            int x = (chunkPos.getBlockX() << 4) + PseudoRandom.random.nextInt(16);
            int z = (chunkPos.getBlockZ() << 4) + PseudoRandom.random.nextInt(16);
            gen.spawn(random, x, z);
        }
    }
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:14,代码来源:Extent.java

示例4: generate

import com.sk89q.worldedit.regions.Region; //导入方法依赖的package包/类
public default void generate(Region region, GenBase gen) throws WorldEditException {
    for (Vector2D chunkPos : region.getChunks()) {
        gen.generate(chunkPos, this);
    }
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:6,代码来源:Extent.java


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