Record Class BlockTransformer
java.lang.Object
java.lang.Record
net.minecraft.core.component.BlockTransformer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic enumstatic enumstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Holder<BlockTransformer>> static final com.mojang.serialization.Codec<BlockTransformer> static final StreamCodec<RegistryFriendlyByteBuf, Holder<BlockTransformer>> private final List<BlockTransformer.BlockTransformData> The field for thetransformsrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionBlockTransformer(List<BlockTransformer.BlockTransformData> transforms) Creates an instance of aBlockTransformerrecord 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.private static booleanfinal StringtoString()Returns a string representation of this record class.transformBlock(UseOnContext context) transformBlock(UseOnContext context, @Nullable Holder<BlockTransformer> transformer) Neo: Added overload to allow running the transform block logic, on a different transformer than the one currently on the stack.Returns the value of thetransformsrecord component.
-
Field Details
-
transforms
The field for thetransformsrecord component. -
DIRECT_CODEC
-
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
BlockTransformer
Creates an instance of aBlockTransformerrecord class.- Parameters:
transforms- the value for thetransformsrecord component
-
-
Method Details
-
transformBlock
-
transformBlock
public InteractionResult transformBlock(UseOnContext context, @Nullable Holder<BlockTransformer> transformer) Neo: Added overload to allow running the transform block logic, on a different transformer than the one currently on the stack. This overload exists for cases like multitools to not require changing the stack's transformer just to append the correct datamap transformers.- Parameters:
context- The use contexttransformer- The holder for the current transformer that will be used to append any datamap based block transforms- Throws:
IllegalArgumentException- iftransformeris present but is for a different holder thanthis
-
playerHasBlockingItemUseIntent
-
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). -
transforms
Returns the value of thetransformsrecord component.- Returns:
- the value of the
transformsrecord component
-