Record Class LightningBoltPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.LightningBoltPredicate
- All Implemented Interfaces:
EntitySubPredicate
public record LightningBoltPredicate(MinMaxBounds.Ints blocksSetOnFire, Optional<EntityPredicate> entityStruck)
extends Record
implements EntitySubPredicate
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MinMaxBounds.IntsThe field for theblocksSetOnFirerecord component.static final com.mojang.serialization.MapCodec<LightningBoltPredicate> private final Optional<EntityPredicate> The field for theentityStruckrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionLightningBoltPredicate(MinMaxBounds.Ints blocksSetOnFire, Optional<EntityPredicate> entityStruck) Creates an instance of aLightningBoltPredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic LightningBoltPredicateblockSetOnFire(MinMaxBounds.Ints p_299013_) Returns the value of theblocksSetOnFirerecord component.com.mojang.serialization.MapCodec<LightningBoltPredicate> codec()Returns the value of theentityStruckrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanmatches(Entity p_299034_, ServerLevel p_299101_, Vec3 p_298929_) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
blocksSetOnFire
The field for theblocksSetOnFirerecord component. -
entityStruck
The field for theentityStruckrecord component. -
CODEC
-
-
Constructor Details
-
LightningBoltPredicate
public LightningBoltPredicate(MinMaxBounds.Ints blocksSetOnFire, Optional<EntityPredicate> entityStruck) Creates an instance of aLightningBoltPredicaterecord class.- Parameters:
blocksSetOnFire- the value for theblocksSetOnFirerecord componententityStruck- the value for theentityStruckrecord component
-
-
Method Details
-
blockSetOnFire
-
codec
- Specified by:
codecin interfaceEntitySubPredicate
-
matches
- Specified by:
matchesin interfaceEntitySubPredicate
-
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). -
blocksSetOnFire
Returns the value of theblocksSetOnFirerecord component.- Returns:
- the value of the
blocksSetOnFirerecord component
-
entityStruck
Returns the value of theentityStruckrecord component.- Returns:
- the value of the
entityStruckrecord component
-