Record Class BlockPredicate
java.lang.Object
java.lang.Record
com.viaversion.viaversion.api.minecraft.item.data.BlockPredicate
- All Implemented Interfaces:
Copyable
,Rewritable
public record BlockPredicate(@Nullable HolderSet holderSet, StatePropertyMatcher @Nullable [] propertyMatchers, @Nullable com.viaversion.nbt.tag.CompoundTag tag, DataComponentMatchers dataMatchers)
extends Record
implements Copyable, Rewritable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Type<BlockPredicate[]>
static final Type<BlockPredicate>
-
Constructor Summary
ConstructorsConstructorDescriptionBlockPredicate
(@Nullable HolderSet holderSet, StatePropertyMatcher @Nullable [] propertyMatchers, @Nullable com.viaversion.nbt.tag.CompoundTag tag) BlockPredicate
(@Nullable HolderSet holderSet, StatePropertyMatcher @Nullable [] propertyMatchers, @Nullable com.viaversion.nbt.tag.CompoundTag tag, DataComponentMatchers dataMatchers) Creates an instance of aBlockPredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Returns the value of thedataMatchers
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.@Nullable HolderSet
Returns the value of theholderSet
record component.StatePropertyMatcher @Nullable []
Returns the value of thepropertyMatchers
record component.rewrite
(UserConnection connection, Protocol<?, ?, ?, ?> protocol, boolean clientbound) Rewrites the object to a different version, may return self or a new object.@Nullable com.viaversion.nbt.tag.CompoundTag
tag()
Returns the value of thetag
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
TYPE1_20_5
-
ARRAY_TYPE1_20_5
-
-
Constructor Details
-
BlockPredicate
public BlockPredicate(@Nullable HolderSet holderSet, StatePropertyMatcher @Nullable [] propertyMatchers, @Nullable com.viaversion.nbt.tag.CompoundTag tag) -
BlockPredicate
public BlockPredicate(@Nullable HolderSet holderSet, StatePropertyMatcher @Nullable [] propertyMatchers, @Nullable com.viaversion.nbt.tag.CompoundTag tag, DataComponentMatchers dataMatchers) Creates an instance of aBlockPredicate
record class.- Parameters:
holderSet
- the value for theholderSet
record componentpropertyMatchers
- the value for thepropertyMatchers
record componenttag
- the value for thetag
record componentdataMatchers
- the value for thedataMatchers
record component
-
-
Method Details
-
rewrite
public BlockPredicate rewrite(UserConnection connection, Protocol<?, ?, ?, ?> protocol, boolean clientbound) Description copied from interface:Rewritable
Rewrites the object to a different version, may return self or a new object.- Specified by:
rewrite
in interfaceRewritable
- Parameters:
connection
- user connectionprotocol
- protocolclientbound
- whether it should be rewritten client- or serverbound- Returns:
- rewritten object, may be (modified or unmodified) self or a new object
-
copy
-
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)
. -
holderSet
Returns the value of theholderSet
record component.- Returns:
- the value of the
holderSet
record component
-
propertyMatchers
Returns the value of thepropertyMatchers
record component.- Returns:
- the value of the
propertyMatchers
record component
-
tag
public @Nullable com.viaversion.nbt.tag.CompoundTag tag()Returns the value of thetag
record component.- Returns:
- the value of the
tag
record component
-
dataMatchers
Returns the value of thedataMatchers
record component.- Returns:
- the value of the
dataMatchers
record component
-