Class BlockProperties

java.lang.Object
fr.fidorial.world.block.BlockProperties

public final class BlockProperties extends Object
The properties shared by many vanilla blocks, and factories for new ones.
Since:
0.1.0
  • Field Details

    • FACING

      public static final BlockProperty FACING
      Facing on all six sides.
      Since:
      0.1.0
    • HORIZONTAL_FACING

      public static final BlockProperty HORIZONTAL_FACING
      Facing on the four horizontal sides.
      Since:
      0.1.0
    • HOPPER_FACING

      public static final BlockProperty HOPPER_FACING
      Facing of a hopper: down or horizontal.
      Since:
      0.1.0
    • AXIS

      public static final BlockProperty AXIS
      Alignment on any axis.
      Since:
      0.1.0
    • HORIZONTAL_AXIS

      public static final BlockProperty HORIZONTAL_AXIS
      Alignment on a horizontal axis.
      Since:
      0.1.0
    • WATERLOGGED

      public static final BlockProperty WATERLOGGED
      Whether the block holds water.
      Since:
      0.1.0
    • POWERED

      public static final BlockProperty POWERED
      Whether the block receives redstone power.
      Since:
      0.1.0
    • LIT

      public static final BlockProperty LIT
      Whether the block is lit.
      Since:
      0.1.0
    • OPEN

      public static final BlockProperty OPEN
      Whether the block is open.
      Since:
      0.1.0
    • SNOWY

      public static final BlockProperty SNOWY
      Whether snow covers the block.
      Since:
      0.1.0
    • HALF

      public static final BlockProperty HALF
      Top or bottom half, for slabs, stairs and trapdoors.
      Since:
      0.1.0
    • DOUBLE_BLOCK_HALF

      public static final BlockProperty DOUBLE_BLOCK_HALF
      Upper or lower half, for doors and tall plants.
      Since:
      0.1.0
    • ROTATION

      public static final BlockProperty ROTATION
      Sixteen-step rotation, for signs, banners and heads.
      Since:
      0.1.0
    • FLUID_LEVEL

      public static final BlockProperty FLUID_LEVEL
      Fluid level, from 0 (source) to 15.
      Since:
      0.1.0
  • Method Details

    • bool

      public static BlockProperty bool(String name)
      Returns a boolean property, accepting true and false.
      Parameters:
      name - the property name
      Returns:
      a boolean property, accepting true and false
      Since:
      0.1.0
    • integer

      public static BlockProperty integer(String name, int min, int max)
      Returns an integer property accepting every value of a range.
      Parameters:
      name - the property name
      min - the lowest value, inclusive
      max - the highest value, inclusive
      Returns:
      an integer property accepting every value of a range
      Throws:
      IllegalArgumentException - if min > max
      Since:
      0.1.0
    • of

      public static BlockProperty of(String name, String... values)
      Returns a property accepting the given values.
      Parameters:
      name - the property name
      values - the accepted values, the first one being the default
      Returns:
      a property accepting the given values
      Since:
      0.1.0