本文整理汇总了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);
}
示例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);
}
示例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);
}
}
}
示例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);
}
}