Record Class ItemFireworkExplosionPredicate.FireworkPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.ItemFireworkExplosionPredicate.FireworkPredicate
- All Implemented Interfaces:
Predicate<FireworkExplosion>
- Enclosing class:
ItemFireworkExplosionPredicate
public static record ItemFireworkExplosionPredicate.FireworkPredicate(Optional<FireworkExplosion.Shape> shape, Optional<Boolean> twinkle, Optional<Boolean> trail)
extends Record
implements Predicate<FireworkExplosion>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<ItemFireworkExplosionPredicate.FireworkPredicate> private final Optional
<FireworkExplosion.Shape> The field for theshape
record component.The field for thetrail
record component.The field for thetwinkle
record component. -
Constructor Summary
ConstructorDescriptionFireworkPredicate
(Optional<FireworkExplosion.Shape> shape, Optional<Boolean> twinkle, Optional<Boolean> trail) Creates an instance of aFireworkPredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.shape()
Returns the value of theshape
record component.boolean
test
(FireworkExplosion p_340895_) final String
toString()
Returns a string representation of this record class.trail()
Returns the value of thetrail
record component.twinkle()
Returns the value of thetwinkle
record component.
-
Field Details
-
shape
The field for theshape
record component. -
twinkle
The field for thetwinkle
record component. -
trail
The field for thetrail
record component. -
CODEC
public static final com.mojang.serialization.Codec<ItemFireworkExplosionPredicate.FireworkPredicate> CODEC
-
-
Constructor Details
-
FireworkPredicate
public FireworkPredicate(Optional<FireworkExplosion.Shape> shape, Optional<Boolean> twinkle, Optional<Boolean> trail) Creates an instance of aFireworkPredicate
record class.- Parameters:
shape
- the value for theshape
record componenttwinkle
- the value for thetwinkle
record componenttrail
- the value for thetrail
record component
-
-
Method Details
-
test
- Specified by:
test
in interfacePredicate<FireworkExplosion>
-
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)
. -
shape
Returns the value of theshape
record component.- Returns:
- the value of the
shape
record component
-
twinkle
Returns the value of thetwinkle
record component.- Returns:
- the value of the
twinkle
record component
-
trail
Returns the value of thetrail
record component.- Returns:
- the value of the
trail
record component
-