Package cn.nukkit.level.terra.delegate
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
ConstructorDescriptionPNXBlockStateDelegate
(BlockState innerBlockState) Creates an instance of aPNXBlockStateDelegate
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.<T extends Comparable<T>>
Tget
(com.dfsek.terra.api.block.state.properties.Property<T> property) getAsString
(boolean b) com.dfsek.terra.api.block.BlockType
<T extends Comparable<T>>
booleanhas
(com.dfsek.terra.api.block.state.properties.Property<T> property) final int
hashCode()
Returns a hash code value for this object.Returns the value of theinnerBlockState
record component.boolean
isAir()
boolean
matches
(com.dfsek.terra.api.block.state.BlockState blockState) <T extends Comparable<T>>
com.dfsek.terra.api.block.state.BlockStateset
(com.dfsek.terra.api.block.state.properties.Property<T> property, T t) final String
toString()
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
Creates an instance of aPNXBlockStateDelegate
record class.- Parameters:
innerBlockState
- the value for theinnerBlockState
record component
-
-
Method Details
-
matches
public boolean matches(com.dfsek.terra.api.block.state.BlockState blockState) - Specified by:
matches
in interfacecom.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 interfacecom.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 interfacecom.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 interfacecom.dfsek.terra.api.block.state.BlockState
-
getBlockType
public com.dfsek.terra.api.block.BlockType getBlockType()- Specified by:
getBlockType
in interfacecom.dfsek.terra.api.block.state.BlockState
-
getAsString
- Specified by:
getAsString
in interfacecom.dfsek.terra.api.block.state.BlockState
-
isAir
public boolean isAir()- Specified by:
isAir
in interfacecom.dfsek.terra.api.block.state.BlockState
-
getHandle
- Specified by:
getHandle
in interfacecom.dfsek.terra.api.Handle
-
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. -
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. -
equals
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 withObjects::equals(Object,Object)
. -
innerBlockState
Returns the value of theinnerBlockState
record component.- Returns:
- the value of the
innerBlockState
record component
-