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

项目:McMMOPlus    文件:Herbalism.java   
/**
 * Convert blocks affected by the Green Thumb & Green Terra abilities.
 *
 * @param blockState The {@link BlockState} to check ability activation for
 * @return true if the ability was successful, false otherwise
 */
protected static boolean convertGreenTerraBlocks(BlockState blockState) {
    switch (blockState.getType()) {
        case COBBLE_WALL:
            blockState.setRawData((byte) 0x1);
            return true;

        case SMOOTH_BRICK:
            ((SmoothBrick) blockState.getData()).setMaterial(Material.MOSSY_COBBLESTONE);
            return true;

        case DIRT:
            blockState.setType(Material.GRASS);
            return true;

        case COBBLESTONE:
            blockState.setType(Material.MOSSY_COBBLESTONE);
            return true;

        default:
            return false;
    }
}
项目:McMMOPlus    文件:BlockUtils.java   
/**
 * Determine if a given block can be made mossy
 *
 * @param blockState The {@link BlockState} of the block to check
 * @return true if the block can be made mossy, false otherwise
 */
public static boolean canMakeMossy(BlockState blockState) {
    switch (blockState.getType()) {
        case COBBLESTONE:
        case DIRT:
            return true;

        case SMOOTH_BRICK:
            return ((SmoothBrick) blockState.getData()).getMaterial() == Material.STONE;

        case COBBLE_WALL:
            return blockState.getRawData() == (byte) 0x0;

        default:
            return false;
    }
}
项目:McMMOPlus    文件:UnarmedManager.java   
public boolean blockCrackerCheck(BlockState blockState) {
    if (!SkillUtils.activationSuccessful(SecondaryAbility.BLOCK_CRACKER, getPlayer())) {
        return false;
    }

    MaterialData data = blockState.getData();

    switch (blockState.getType()) {
        case SMOOTH_BRICK:
            if (!Unarmed.blockCrackerSmoothBrick) {
                return false;
            }

            // Yes, this is awkward, but it's the *right* way to do it.
            SmoothBrick smoothBrick = (SmoothBrick) data;

            if (smoothBrick.getMaterial() != Material.STONE) {
                return false;
            }

            smoothBrick.setMaterial(Material.COBBLESTONE);
            return true;

        default:
            return false;
    }
}
项目:McMMOPlus    文件:BlockUtils.java   
/**
 * Determine if a given block should be affected by Block Cracker
 *
 * @param blockState The {@link BlockState} of the block to check
 * @return true if the block should affected by Block Cracker, false otherwise
 */
public static boolean affectedByBlockCracker(BlockState blockState) {
    switch (blockState.getType()) {
        case SMOOTH_BRICK:
            return ((SmoothBrick) blockState.getData()).getMaterial() == Material.STONE;

        default:
            return false;
    }
}
项目:BedrockAPI    文件:SmoothBrick.java   
public SmoothBrick() {
}
项目:BedrockAPI    文件:SmoothBrick.java   
@Deprecated public SmoothBrick(int type) {
}
项目:BedrockAPI    文件:SmoothBrick.java   
public SmoothBrick(Material type) {
}
项目:BedrockAPI    文件:SmoothBrick.java   
@Deprecated public SmoothBrick(int type, byte data) {
}
项目:BedrockAPI    文件:SmoothBrick.java   
@Deprecated public SmoothBrick(Material type, byte data) {
}
项目:BedrockAPI    文件:SmoothBrick.java   
public SmoothBrick clone() {
    return null;
}