Record Class DataComponentPredicate.Fireworks
java.lang.Object
java.lang.Record
net.minestom.server.instance.block.predicate.DataComponentPredicate.Fireworks
- Record Components:
explosions- Predicates to match against the object's firework explosions, or null to allow anyflightDuration- The allowed range of flight duration, or null to allow any
- All Implemented Interfaces:
Predicate<DataComponent.Holder>, DataComponentPredicate, DataComponentPredicate.Registered
- Enclosing interface:
DataComponentPredicate
public static record DataComponentPredicate.Fireworks(@Nullable CollectionPredicate<FireworkExplosion, DataComponentPredicate.FireworkExplosionPredicate> explosions, Range.Int flightDuration)
extends Record
implements DataComponentPredicate.Registered
Tests the firework explosions and flight duration in the
DataComponents.FIREWORKS component.-
Nested Class Summary
Nested classes/interfaces inherited from interface DataComponentPredicate
DataComponentPredicate.ArmorTrim, DataComponentPredicate.AttributeModifierPredicate, DataComponentPredicate.AttributeModifiers, DataComponentPredicate.BundleContents, DataComponentPredicate.Container, DataComponentPredicate.CustomData, DataComponentPredicate.Damage, DataComponentPredicate.EnchantmentListPredicate, DataComponentPredicate.Enchantments, DataComponentPredicate.Exists, DataComponentPredicate.FireworkExplosion, DataComponentPredicate.FireworkExplosionPredicate, DataComponentPredicate.Fireworks, DataComponentPredicate.JukeboxPlayable, DataComponentPredicate.Potions, DataComponentPredicate.Registered, DataComponentPredicate.StoredEnchantments, DataComponentPredicate.VillagerVariant, DataComponentPredicate.WritableBook, DataComponentPredicate.WrittenBook -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFireworks(@Nullable CollectionPredicate<FireworkExplosion, DataComponentPredicate.FireworkExplosionPredicate> explosions, Range.Int flightDuration) Creates an instance of aFireworksrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncodec()Returns the codec registered for this predicate type.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexplosionsrecord component.Returns the value of theflightDurationrecord component.final inthashCode()Returns a hash code value for this object.booleantest(DataComponent.Holder holder) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
Fireworks
public Fireworks(@Nullable @Nullable CollectionPredicate<FireworkExplosion, DataComponentPredicate.FireworkExplosionPredicate> explosions, @Nullable Range.Int flightDuration) Creates an instance of aFireworksrecord class.- Parameters:
explosions- the value for theexplosionsrecord componentflightDuration- the value for theflightDurationrecord component
-
-
Method Details
-
test
- Specified by:
testin interfacePredicate<DataComponent.Holder>
-
codec
Description copied from interface:DataComponentPredicate.RegisteredReturns the codec registered for this predicate type.- Specified by:
codecin interfaceDataComponentPredicate.Registered- Returns:
- the predicate codec
-
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). -
explosions
@Nullable public @Nullable CollectionPredicate<FireworkExplosion, DataComponentPredicate.FireworkExplosionPredicate> explosions()Returns the value of theexplosionsrecord component.- Returns:
- the value of the
explosionsrecord component
-
flightDuration
Returns the value of theflightDurationrecord component.- Returns:
- the value of the
flightDurationrecord component
-