Record Class BlockReplacement
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.BlockReplacement
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BlockReplacement> private final BlockStateThe field for thestaterecord component.private final RuleTestThe field for thetargetrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionBlockReplacement(RuleTest target, BlockState state) Creates an instance of aBlockReplacementrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static BlockReplacementreplace(RuleTest rule, BlockState state) state()Returns the value of thestaterecord component.target()Returns the value of thetargetrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
target
The field for thetargetrecord component. -
state
The field for thestaterecord component. -
CODEC
-
-
Constructor Details
-
BlockReplacement
Creates an instance of aBlockReplacementrecord class.- Parameters:
target- the value for thetargetrecord componentstate- the value for thestaterecord component
-
-
Method Details
-
replace
-
toString
-
hashCode
-
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). -
target
Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-