Record Class BlockItemStateProperties
java.lang.Object
java.lang.Record
net.minecraft.world.item.component.BlockItemStateProperties
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BlockItemStateProperties> static final BlockItemStatePropertiesThe field for thepropertiesrecord component.private static final StreamCodec<io.netty.buffer.ByteBuf, Map<String, String>> static final StreamCodec<io.netty.buffer.ByteBuf, BlockItemStateProperties> -
Constructor Summary
ConstructorsConstructorDescriptionBlockItemStateProperties(Map<String, String> properties) Creates an instance of aBlockItemStatePropertiesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionapply(BlockState p_330225_) final booleanIndicates whether some other object is "equal to" this one.<T extends Comparable<T>>
Tfinal inthashCode()Returns a hash code value for this object.booleanisEmpty()Returns the value of thepropertiesrecord component.final StringtoString()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 thepropertiesrecord 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 aBlockItemStatePropertiesrecord class.- Parameters:
properties- the value for thepropertiesrecord 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 thepropertiesrecord component.- Returns:
- the value of the
propertiesrecord component
-