本文整理汇总了Java中org.bukkit.util.BlockVector.getBlockZ方法的典型用法代码示例。如果您正苦于以下问题:Java BlockVector.getBlockZ方法的具体用法?Java BlockVector.getBlockZ怎么用?Java BlockVector.getBlockZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.util.BlockVector
的用法示例。
在下文中一共展示了BlockVector.getBlockZ方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RegionSave
import org.bukkit.util.BlockVector; //导入方法依赖的package包/类
public RegionSave(RegionModule region) {
BlockVector min = blockAlign(region.getMin());
BlockVector max = blockAlign(region.getMax());
BlockVector size = max.minus(min).toBlockVector();
this.min = min;
this.size = size;
List<Pair<Material,Byte>> blocks = new ArrayList<>();
for (int z = min.getBlockZ(); z < max.getBlockZ(); z++) {
for (int y = min.getBlockY(); y < max.getBlockY(); y++) {
for (int x = min.getBlockX(); x < max.getBlockX(); x++) {
Block block = new Location(GameHandler.getGameHandler().getMatchWorld(), x, y, z).getBlock();
blocks.add(new ImmutablePair<>(block.getType(), block.getData()));
}
}
}
this.blocks = blocks;
}
示例2: getRelative
import org.bukkit.util.BlockVector; //导入方法依赖的package包/类
public static BlockVector getRelative(BlockVector pos, BlockFace face) {
return new BlockVector(pos.getBlockX() + face.getModX(),
pos.getBlockY() + face.getModY(),
pos.getBlockZ() + face.getModZ());
}
示例3: getBlockAt
import org.bukkit.util.BlockVector; //导入方法依赖的package包/类
public Pair<Material,Byte> getBlockAt(BlockVector loc) {
int x = loc.getBlockX() - min.getBlockX();
int y = (loc.getBlockY() - this.min.getBlockY()) * this.size.getBlockX();
int z = (loc.getBlockZ() - this.min.getBlockZ()) * this.size.getBlockX() * this.size.getBlockY();
return blocks.get(x + y + z);
}
示例4: Region
import org.bukkit.util.BlockVector; //导入方法依赖的package包/类
/**
* Instantiates a new Region data.
*
* @param min the vector to use for the min point.
* @param max the vector to use for the max point.
* @param world the world name as a string the 2 points are in.
*/
public Region(BlockVector min, BlockVector max, String world) {
this.minPoint = new BlockPoint(world, min.getBlockX(), min.getBlockY(), min.getBlockZ());
this.maxPoint = new BlockPoint(world, max.getBlockX(), max.getBlockY(), max.getBlockZ());
this.world = world;
}