Record Class BlockReplacement
java.lang.Object
java.lang.Record
dev.wyck.renderer.packet.data.BlockReplacement
@NullMarked
@AsOf("0.0.6")
public record BlockReplacement(Material original, Material replacement)
extends Record
A data class representing a block replacement rule.
- Since:
- 0.0.6
-
Constructor Summary
ConstructorsConstructorDescriptionBlockReplacement(Material original, Material replacement) 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 Collection<BlockReplacement> of(Collection<Material> originals, Collection<Material> replacements) Creates a collection of BlockReplacement instances from a collection of original block materials and a collection of replacement block materials.static Collection<BlockReplacement> Creates a collection of BlockReplacement instances from a map of original and replacement block materials.static Collection<BlockReplacement> Creates a collection of BlockReplacement instances from an array of materials.static BlockReplacementCreates a new BlockReplacement instance.original()Returns the value of theoriginalrecord component.Returns the original block material.Returns the value of thereplacementrecord component.Returns the replacement block material.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
BlockReplacement
-
-
Method Details
-
originalBlock
-
replacementBlock
-
of
Creates a new BlockReplacement instance.- Parameters:
originalBlock- the original block materialreplacementBlock- the replacement block material- Returns:
- a new BlockReplacement instance
-
of
Creates a collection of BlockReplacement instances from a map of original and replacement block materials.- Parameters:
replacements- the map of original and replacement block materials- Returns:
- a collection of BlockReplacement instances
-
of
@AsOf("2.1.0") public static Collection<BlockReplacement> of(Collection<Material> originals, Collection<Material> replacements) Creates a collection of BlockReplacement instances from a collection of original block materials and a collection of replacement block materials.- Parameters:
originals- the collection of original block materialsreplacements- the collection of replacement block materials- Returns:
- a collection of BlockReplacement instances
-
of
Creates a collection of BlockReplacement instances from an array of materials.- Parameters:
replacements- the array of materials- Returns:
- a collection of BlockReplacement instances
-
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). -
original
Returns the value of theoriginalrecord component.- Returns:
- the value of the
originalrecord component
-
replacement
Returns the value of thereplacementrecord component.- Returns:
- the value of the
replacementrecord component
-