Record Class PNXBlockStateDelegate

java.lang.Object
java.lang.Record
cn.nukkit.level.terra.delegate.PNXBlockStateDelegate
All Implemented Interfaces:
com.dfsek.terra.api.block.state.BlockState, com.dfsek.terra.api.Handle

@PowerNukkitXOnly @Since("1.6.0.0-PNX") public record PNXBlockStateDelegate(BlockState innerBlockState) extends Record implements com.dfsek.terra.api.block.state.BlockState
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of a PNXBlockStateDelegate record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    <T extends Comparable<T>>
    T
    get(com.dfsek.terra.api.block.state.properties.Property<T> property)
     
    getAsString(boolean b)
     
    com.dfsek.terra.api.block.BlockType
     
     
    <T extends Comparable<T>>
    boolean
    has(com.dfsek.terra.api.block.state.properties.Property<T> property)
     
    final int
    Returns a hash code value for this object.
    Returns the value of the innerBlockState record component.
    boolean
     
    boolean
    matches(com.dfsek.terra.api.block.state.BlockState blockState)
     
    <T extends Comparable<T>>
    com.dfsek.terra.api.block.state.BlockState
    set(com.dfsek.terra.api.block.state.properties.Property<T> property, T t)
     
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.dfsek.terra.api.block.state.BlockState

    getAsString, ifProperty, setIfPresent
  • Constructor Details

    • PNXBlockStateDelegate

      public PNXBlockStateDelegate(BlockState innerBlockState)
      Creates an instance of a PNXBlockStateDelegate record class.
      Parameters:
      innerBlockState - the value for the innerBlockState record component
  • Method Details

    • matches

      public boolean matches(com.dfsek.terra.api.block.state.BlockState blockState)
      Specified by:
      matches in interface com.dfsek.terra.api.block.state.BlockState
    • has

      public <T extends Comparable<T>> boolean has(com.dfsek.terra.api.block.state.properties.Property<T> property)
      Specified by:
      has in interface com.dfsek.terra.api.block.state.BlockState
    • get

      public <T extends Comparable<T>> T get(com.dfsek.terra.api.block.state.properties.Property<T> property)
      Specified by:
      get in interface com.dfsek.terra.api.block.state.BlockState
    • set

      public <T extends Comparable<T>> com.dfsek.terra.api.block.state.BlockState set(com.dfsek.terra.api.block.state.properties.Property<T> property, T t)
      Specified by:
      set in interface com.dfsek.terra.api.block.state.BlockState
    • getBlockType

      public com.dfsek.terra.api.block.BlockType getBlockType()
      Specified by:
      getBlockType in interface com.dfsek.terra.api.block.state.BlockState
    • getAsString

      public String getAsString(boolean b)
      Specified by:
      getAsString in interface com.dfsek.terra.api.block.state.BlockState
    • isAir

      public boolean isAir()
      Specified by:
      isAir in interface com.dfsek.terra.api.block.state.BlockState
    • getHandle

      public BlockState getHandle()
      Specified by:
      getHandle in interface com.dfsek.terra.api.Handle
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • innerBlockState

      public BlockState innerBlockState()
      Returns the value of the innerBlockState record component.
      Returns:
      the value of the innerBlockState record component