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


Java BlockVector.getBlockZ方法代码示例

本文整理汇总了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;
}
 
开发者ID:twizmwazin,项目名称:CardinalPGM,代码行数:20,代码来源:RegionSave.java

示例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());
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:6,代码来源:BlockFaces.java

示例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);
}
 
开发者ID:twizmwazin,项目名称:CardinalPGM,代码行数:7,代码来源:RegionSave.java

示例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;
}
 
开发者ID:Relicum,项目名称:Ipsum,代码行数:13,代码来源:Region.java


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