本文整理汇总了Java中com.sk89q.worldedit.regions.Region.getWorld方法的典型用法代码示例。如果您正苦于以下问题:Java Region.getWorld方法的具体用法?Java Region.getWorld怎么用?Java Region.getWorld使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sk89q.worldedit.regions.Region
的用法示例。
在下文中一共展示了Region.getWorld方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ConvexPolyhedralRegionSelector
import com.sk89q.worldedit.regions.Region; //导入方法依赖的package包/类
/**
* Create a new selector.
*
* @param oldSelector the old selector
*/
public ConvexPolyhedralRegionSelector(RegionSelector oldSelector) {
checkNotNull(oldSelector);
if (oldSelector instanceof ConvexPolyhedralRegionSelector) {
final ConvexPolyhedralRegionSelector convexPolyhedralRegionSelector = (ConvexPolyhedralRegionSelector) oldSelector;
pos1 = convexPolyhedralRegionSelector.pos1;
region = new ConvexPolyhedralRegion(convexPolyhedralRegionSelector.region);
} else {
final Region oldRegion;
try {
oldRegion = oldSelector.getRegion();
} catch (IncompleteRegionException e) {
region = new ConvexPolyhedralRegion(oldSelector.getIncompleteRegion().getWorld());
return;
}
final int minY = oldRegion.getMinimumPoint().getBlockY();
final int maxY = oldRegion.getMaximumPoint().getBlockY();
region = new ConvexPolyhedralRegion(oldRegion.getWorld());
for (final BlockVector2D pt : new ArrayList<BlockVector2D>(oldRegion.polygonize(Integer.MAX_VALUE))) {
region.addVertex(pt.toVector(minY));
region.addVertex(pt.toVector(maxY));
}
learnChanges();
}
}