本文整理汇总了Java中com.sk89q.worldedit.regions.CuboidRegion.getArea方法的典型用法代码示例。如果您正苦于以下问题:Java CuboidRegion.getArea方法的具体用法?Java CuboidRegion.getArea怎么用?Java CuboidRegion.getArea使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sk89q.worldedit.regions.CuboidRegion
的用法示例。
在下文中一共展示了CuboidRegion.getArea方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setBlocks
import com.sk89q.worldedit.regions.CuboidRegion; //导入方法依赖的package包/类
default int setBlocks(CuboidRegion cuboid, final int id, final int data) {
RegionWrapper current = new RegionWrapper(cuboid.getMinimumPoint(), cuboid.getMaximumPoint());
final int minY = cuboid.getMinimumY();
final int maxY = cuboid.getMaximumY();
final FaweChunk<?> fc = getFaweChunk(0, 0);
final byte dataByte = (byte) data;
fc.fillCuboid(0, 15, minY, maxY, 0, 15, id, dataByte);
fc.optimize();
int bcx = (current.minX) >> 4;
int bcz = (current.minZ) >> 4;
int tcx = (current.maxX) >> 4;
int tcz = (current.maxZ) >> 4;
// [chunkx, chunkz, pos1x, pos1z, pos2x, pos2z, isedge]
MainUtil.chunkTaskSync(current, new RunnableVal<int[]>() {
@Override
public void run(int[] value) {
FaweChunk newChunk;
if (value[6] == 0) {
newChunk = fc.copy(true);
newChunk.setLoc(FaweQueue.this, value[0], value[1]);
} else {
int bx = value[2] & 15;
int tx = value[4] & 15;
int bz = value[3] & 15;
int tz = value[5] & 15;
if (bx == 0 && tx == 15 && bz == 0 && tz == 15) {
newChunk = fc.copy(true);
newChunk.setLoc(FaweQueue.this, value[0], value[1]);
} else {
newChunk = FaweQueue.this.getFaweChunk(value[0], value[1]);
newChunk.fillCuboid(value[2] & 15, value[4] & 15, minY, maxY, value[3] & 15, value[5] & 15, id, dataByte);
}
}
newChunk.addToQueue();
}
});
return cuboid.getArea();
}