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
Modifier and TypeFieldDescriptionprivate final MinMaxBounds.Ints
The field for theblocksSetOnFire
record component.static final com.mojang.serialization.MapCodec
<LightningBoltPredicate> private final Optional
<EntityPredicate> The field for theentityStruck
record component. -
Constructor Summary
ConstructorDescriptionLightningBoltPredicate
(MinMaxBounds.Ints blocksSetOnFire, Optional<EntityPredicate> entityStruck) Creates an instance of aLightningBoltPredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic LightningBoltPredicate
blockSetOnFire
(MinMaxBounds.Ints p_297323_) Returns the value of theblocksSetOnFire
record component.com.mojang.serialization.MapCodec
<LightningBoltPredicate> codec()
Returns the value of theentityStruck
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.boolean
matches
(Entity p_300332_, ServerLevel p_297594_, Vec3 p_298602_) final String
toString()
Returns a string representation of this record class.
-
Field Details
-
blocksSetOnFire
The field for theblocksSetOnFire
record component. -
entityStruck
The field for theentityStruck
record component. -
CODEC
-
-
Constructor Details
-
LightningBoltPredicate
public LightningBoltPredicate(MinMaxBounds.Ints blocksSetOnFire, Optional<EntityPredicate> entityStruck) Creates an instance of aLightningBoltPredicate
record class.- Parameters:
blocksSetOnFire
- the value for theblocksSetOnFire
record componententityStruck
- the value for theentityStruck
record component
-
-
Method Details
-
blockSetOnFire
-
codec
- Specified by:
codec
in interfaceEntitySubPredicate
-
matches
- Specified by:
matches
in 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 theblocksSetOnFire
record component.- Returns:
- the value of the
blocksSetOnFire
record component
-
entityStruck
Returns the value of theentityStruck
record component.- Returns:
- the value of the
entityStruck
record component
-