Java 类org.bukkit.material.Step 实例源码

项目:Arc-v2    文件:LocationHelper.java   
/**
 * @return if we are on a slab.
 */
public static boolean isOnSlab(Location location) {
    LocationBit bit = new LocationBit(0.5);

    // check if were already under that block.
    Location subtracted = location.clone().subtract(0, 0.1, 0);
    Block subtractedBlock = subtracted.getBlock();

    if (subtractedBlock.getType().getData().equals(Step.class)) {
        return true;
    }

    for (int i = 1; i <= 4; i++) {
        Location newLocation = location.clone().add(bit.getX(), -0.1, bit.getZ());
        Block block = newLocation.getBlock();
        if (block.getType().getData().equals(Step.class)) {
            return true;
        }
        bit.shift(i);
    }
    return false;
}
项目:PlotSquared-Chinese    文件:BukkitUtil.java   
@Override
public boolean isBlockSolid(PlotBlock block) {
    try {
        Material material = Material.getMaterial(block.id);
        if (material.isBlock() && material.isSolid() && !material.hasGravity()) {
            Class<? extends MaterialData> data = material.getData();
            if (data.equals(MaterialData.class) || data.equals(Tree.class) || data.equals(Sandstone.class) || data.equals(Wool.class) || data.equals(Step.class)) {
                return true;
            }
        }
        return false;
    }
    catch (Exception e) {
        return false;
    }
}
项目:PlotSquared    文件:BukkitUtil.java   
@Override
public boolean isBlockSolid(PlotBlock block) {
    try {
        Material material = Material.getMaterial(block.id);
        if (material.isBlock() && material.isSolid() && !material.hasGravity()) {
            Class<? extends MaterialData> data = material.getData();
            if (data.equals(MaterialData.class) && !material.isTransparent() && material.isOccluding()
                    || data.equals(Tree.class)
                    || data.equals(Sandstone.class)
                    || data.equals(Wool.class)
                    || data.equals(Step.class)
                    || data.equals(WoodenStep.class)) {
                switch (material) {
                    case NOTE_BLOCK:
                    case MOB_SPAWNER:
                        return false;
                    default:
                        return true;
                }
            }
        }
        return false;
    } catch (Exception ignored) {
        return false;
    }
}
项目:BedrockAPI    文件:Step.java   
public Step() {
}
项目:BedrockAPI    文件:Step.java   
@Deprecated public Step(int type) {
}
项目:BedrockAPI    文件:Step.java   
public Step(Material type) {
}
项目:BedrockAPI    文件:Step.java   
@Deprecated public Step(int type, byte data) {
}
项目:BedrockAPI    文件:Step.java   
@Deprecated public Step(Material type, byte data) {
}
项目:BedrockAPI    文件:Step.java   
public Step clone() {
    return null;
}