Interface BlockState

All Superinterfaces:
Keyed, Registry.Entry
All Known Subinterfaces:
Block.Entity<B>

public interface BlockState extends Registry.Entry
Represents a state of a block.
  • Method Details

    • key

      @NotNull @NotNull Key key()
      Gets the key of the state.
      Specified by:
      key in interface Keyed
      Returns:
      the state's id
      Since:
      1.0.0
    • id

      int id()
      Gets the id of the state.
      Specified by:
      id in interface Registry.Entry
      Returns:
      the state's id
      Since:
      1.0.0
    • destroyTime

      float destroyTime()
      Gets the destroy time of the block.
      Returns:
      the destroy time of the block
      Since:
      1.0.0
    • properties

      @NotNull @NotNull Map<String,String> properties()
      Gets the properties of the state.
      Returns:
      the state's properties
      Since:
      1.0.0
    • hasProperty

      boolean hasProperty(@NotNull @NotNull String key)
      Checks if the state has the property with the specified key.
      Parameters:
      key - the key of the property
      Returns:
      whether the state has the key or not
      Since:
      1.0.0
    • property

      BlockState property(@NotNull @NotNull String key, @NotNull @NotNull String value)
      Sets the property with the specified key to the specified value.
      Parameters:
      key - the key of the property
      value - the value the porperty should be set to
      Returns:
      the state
      Since:
      1.0.0
    • property

      BlockState property(@NotNull @NotNull String key, boolean value)
      Sets the property with the specified key to the specified value.
      Parameters:
      key - the key of the property
      value - the value the property should be set to
      Returns:
      the state
      Since:
      1.0.0
    • property

      BlockState property(@NotNull @NotNull String key, int value)
      Sets the property with the specified key to the specified value.
      Parameters:
      key - the key of the property
      value - the value the property should be set to
      Returns:
      the state
      Since:
      1.0.0
    • property

      String property(@NotNull @NotNull String key)
      Gets the property of the specified key.
      Parameters:
      key - the key of the property
      Returns:
      the property
      Since:
      1.0.0
    • properties

      BlockState properties(@NotNull @NotNull Map<String,String> properties)
      Sets the properties.
      Parameters:
      properties - the properties to set
      Returns:
      the state
      Since:
      1.0.0