Record Class BlockItemStateProperties
java.lang.Object
java.lang.Record
net.minecraft.world.item.component.BlockItemStateProperties
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<BlockItemStateProperties> static final BlockItemStateProperties
The field for theproperties
record component.private static final StreamCodec
<io.netty.buffer.ByteBuf, Map<String, String>> static final StreamCodec
<io.netty.buffer.ByteBuf, BlockItemStateProperties> -
Constructor Summary
ConstructorDescriptionBlockItemStateProperties
(Map<String, String> properties) Creates an instance of aBlockItemStateProperties
record class. -
Method Summary
Modifier and TypeMethodDescriptionapply
(BlockState p_330225_) final boolean
Indicates whether some other object is "equal to" this one.<T extends Comparable<T>>
Tfinal int
hashCode()
Returns a hash code value for this object.boolean
isEmpty()
Returns the value of theproperties
record component.final String
toString()
Returns a string representation of this record class.private static <T extends Comparable<T>>
BlockStateupdateState
(BlockState p_331833_, Property<T> p_331585_, String p_331923_) <T extends Comparable<T>>
BlockItemStatePropertieswith
(Property<T> p_330873_, BlockState p_330751_) <T extends Comparable<T>>
BlockItemStateProperties
-
Field Details
-
properties
The field for theproperties
record component. -
EMPTY
-
CODEC
-
PROPERTIES_STREAM_CODEC
private static final StreamCodec<io.netty.buffer.ByteBuf,Map<String, PROPERTIES_STREAM_CODECString>> -
STREAM_CODEC
-
-
Constructor Details
-
BlockItemStateProperties
Creates an instance of aBlockItemStateProperties
record class.- Parameters:
properties
- the value for theproperties
record component
-
-
Method Details
-
with
-
with
public <T extends Comparable<T>> BlockItemStateProperties with(Property<T> p_330873_, BlockState p_330751_) -
get
-
apply
-
updateState
private static <T extends Comparable<T>> BlockState updateState(BlockState p_331833_, Property<T> p_331585_, String p_331923_) -
isEmpty
public boolean isEmpty() -
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)
. -
properties
Returns the value of theproperties
record component.- Returns:
- the value of the
properties
record component
-