Class BlockState

java.lang.Object
org.geysermc.geyser.level.block.type.BlockState

public final class BlockState extends Object
  • Constructor Details

    • BlockState

      public BlockState(Block block, int javaId)
  • Method Details

    • getValue

      public <T extends Comparable<T>> T getValue(Property<T> property)
    • getValueNullable

      public <T extends Comparable<T>> T getValueNullable(Property<T> property)
    • getValue

      public <T extends Comparable<T>> T getValue(Property<T> property, T def)
    • withValue

      public <T extends Comparable<T>> BlockState withValue(Property<T> property, T value)
      Returns:
      the BlockState instance with the given value.
    • block

      public Block block()
    • javaId

      public int javaId()
    • is

      public boolean is(Block block)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • of

      public static @NonNull BlockState of(int javaId)
      Null-safe method that looks up a Java block state ID in the BLOCK_STATES registry, and defaults to air if not found.
      Parameters:
      javaId - the Java block state ID to look up.
      Returns:
      the corresponding block state, or air if the given ID wasn't registered and returned null.