Search in sources :

Example 1 with Half

use of org.bukkit.block.data.Bisected.Half in project NoCheatPlus by NoCheatPlus.

the class BukkitStairs method getFakeData.

@Override
public int getFakeData(final BlockCache blockCache, final World world, final int x, final int y, final int z) {
    final Block block = world.getBlockAt(x, y, z);
    final BlockState state = block.getState();
    final BlockData blockData = state.getBlockData();
    if (blockData instanceof Bisected) {
        final Bisected stairs = (Bisected) blockData;
        final Half half = stairs.getHalf();
        // TODO: Refine later, with sub shapes.
        switch(half) {
            case TOP:
                return 0x4;
            default:
                break;
        }
    }
    return 0;
}
Also used : Half(org.bukkit.block.data.Bisected.Half) BlockState(org.bukkit.block.BlockState) Block(org.bukkit.block.Block) BlockData(org.bukkit.block.data.BlockData) Bisected(org.bukkit.block.data.Bisected)

Aggregations

Block (org.bukkit.block.Block)1 BlockState (org.bukkit.block.BlockState)1 Bisected (org.bukkit.block.data.Bisected)1 Half (org.bukkit.block.data.Bisected.Half)1 BlockData (org.bukkit.block.data.BlockData)1