/** * 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; } }
/** * 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; } }
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; } }
/** * 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; } }
public SmoothBrick() { }
@Deprecated public SmoothBrick(int type) { }
public SmoothBrick(Material type) { }
@Deprecated public SmoothBrick(int type, byte data) { }
@Deprecated public SmoothBrick(Material type, byte data) { }
public SmoothBrick clone() { return null; }