Record Class StatePropertiesPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.StatePropertiesPredicate
public record StatePropertiesPredicate(List<StatePropertiesPredicate.PropertyMatcher> properties)
extends Record
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
(package private) static final record
(package private) static final record
(package private) static final record
(package private) static interface
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<StatePropertiesPredicate>
private final List<StatePropertiesPredicate.PropertyMatcher>
The field for theproperties
record component.private static final com.mojang.serialization.Codec<List<StatePropertiesPredicate.PropertyMatcher>>
-
Constructor Summary
ConstructorDescriptionCreates an instance of aStatePropertiesPredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptioncheckState
(StateDefinition<?, ?> p_298590_) void
checkState
(StateDefinition<?, ?> p_67673_, Consumer<String> p_67674_) final boolean
Indicates whether some other object is "equal to" this one.static Optional<StatePropertiesPredicate>
fromJson
(com.google.gson.JsonElement p_67680_) final int
hashCode()
Returns a hash code value for this object.boolean
matches
(BlockState p_67668_) <S extends StateHolder<?,
S>>
booleanmatches
(StateDefinition<?, S> p_67670_, S p_67671_) boolean
matches
(FluidState p_67685_) Returns the value of theproperties
record component.com.google.gson.JsonElement
final String
toString()
Returns a string representation of this record class.
-
Field Details
-
properties
The field for theproperties
record component. -
PROPERTIES_CODEC
private static final com.mojang.serialization.Codec<List<StatePropertiesPredicate.PropertyMatcher>> PROPERTIES_CODEC -
CODEC
-
-
Constructor Details
-
StatePropertiesPredicate
Creates an instance of aStatePropertiesPredicate
record class.- Parameters:
properties
- the value for theproperties
record component
-
-
Method Details
-
matches
-
matches
-
matches
-
checkState
-
checkState
-
fromJson
public static Optional<StatePropertiesPredicate> fromJson(@Nullable com.google.gson.JsonElement p_67680_) -
serializeToJson
public com.google.gson.JsonElement serializeToJson() -
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 theproperties
record component.- Returns:
- the value of the
properties
record component
-