Java Code Examples for org.bukkit.block.BlockState.getY()

The following are Jave code examples for showing how to use getY() of the org.bukkit.block.BlockState class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: Uranium   File: StructureGrowDelegate.java   Source Code and License Vote up 5 votes
public int getTypeId(int x, int y, int z) {
    for (BlockState state : blocks) {
        if (state.getX() == x && state.getY() == y && state.getZ() == z) {
            return state.getTypeId();
        }
    }

    return world.getBlockTypeIdAt(x, y, z);
}
 
Example 2
Project: Uranium   File: StructureGrowDelegate.java   Source Code and License Vote up 5 votes
public boolean isEmpty(int x, int y, int z) {
    for (BlockState state : blocks) {
        if (state.getX() == x && state.getY() == y && state.getZ() == z) {
            return net.minecraft.block.Block.getBlockById(state.getTypeId()) == net.minecraft.init.Blocks.air;
        }
    }

    return world.getBlockAt(x, y, z).isEmpty();
}
 
Example 3
Project: ProjectAres   File: VoidFilter.java   Source Code and License Vote up 5 votes
@Override
public boolean matches(IBlockQuery query) {
    final BlockState block = query.getBlock();
    return block.getY() == 0 ||
           (!query.getMatch().needMatchModule(WorldProblemMatchModule.class).wasBlock36(block.getX(), 0, block.getZ()) &&
            block.getWorld().getBlockAt(block.getX(), 0, block.getZ()).getType() == Material.AIR);
}
 
Example 4
Project: ProjectAres   File: BlockEventQuery.java   Source Code and License Vote up 4 votes
public BlockEventQuery(Event event, BlockState block) {
    this(event, block.getWorld(), block.getX(), block.getY(), block.getZ(), block);
}
 
Example 5
Project: ProjectAres   File: BlockQuery.java   Source Code and License Vote up 4 votes
public BlockQuery(BlockState block) {
    this(block.getWorld(), block.getX(), block.getY(), block.getZ(), block);
}
 
Example 6
Project: ProjectAres   File: BlockStateUtils.java   Source Code and License Vote up 4 votes
public static String format(BlockState state) {
    return "BlockState{pos=(" + state.getX() + ", " + state.getY() + ", " + state.getZ() +
           ") material=" + state.getMaterialData() + "}";
}
 
Example 7
Project: ProjectAres   File: BlockUtils.java   Source Code and License Vote up 4 votes
public static BlockVector position(BlockState block) {
    return new BlockVector(block.getX(), block.getY(), block.getZ());
}