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_330089_) 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_335297_, Property<T> p_336285_, String p_328779_) <T extends Comparable<T>>
BlockItemStatePropertieswith
(Property<T> p_332443_, BlockState p_334050_) <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_332443_, BlockState p_334050_) -
get
-
apply
-
updateState
private static <T extends Comparable<T>> BlockState updateState(BlockState p_335297_, Property<T> p_336285_, String p_328779_) -
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
-