Record Class AllPotatoProjectileEntityHitActions.SetOnFire
java.lang.Object
java.lang.Record
com.simibubi.create.content.equipment.potatoCannon.AllPotatoProjectileEntityHitActions.SetOnFire
- All Implemented Interfaces:
PotatoProjectileEntityHitAction
- Enclosing class:
AllPotatoProjectileEntityHitActions
public static record AllPotatoProjectileEntityHitActions.SetOnFire(int ticks)
extends Record
implements PotatoProjectileEntityHitAction
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.simibubi.create.api.equipment.potatoCannon.PotatoProjectileEntityHitAction
PotatoProjectileEntityHitAction.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<AllPotatoProjectileEntityHitActions.SetOnFire> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<? extends PotatoProjectileEntityHitAction> codec()final booleanIndicates whether some other object is "equal to" this one.booleanexecute(net.minecraft.world.item.ItemStack projectile, net.minecraft.world.phys.EntityHitResult ray, PotatoProjectileEntityHitAction.Type type) final inthashCode()Returns a hash code value for this object.seconds(int seconds) intticks()Returns the value of theticksrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
public static final com.mojang.serialization.MapCodec<AllPotatoProjectileEntityHitActions.SetOnFire> CODEC
-
-
Constructor Details
-
SetOnFire
public SetOnFire(int ticks) Creates an instance of aSetOnFirerecord class.- Parameters:
ticks- the value for theticksrecord component
-
-
Method Details
-
seconds
-
execute
public boolean execute(net.minecraft.world.item.ItemStack projectile, net.minecraft.world.phys.EntityHitResult ray, PotatoProjectileEntityHitAction.Type type) - Specified by:
executein interfacePotatoProjectileEntityHitAction- Returns:
- true if the hit should be canceled if the type is
PRE_HIT, true if this shouldn't recover the projectile if the type isON_HIT
-
codec
- Specified by:
codecin interfacePotatoProjectileEntityHitAction
-
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 with '=='. -
ticks
public int ticks()Returns the value of theticksrecord component.- Returns:
- the value of the
ticksrecord component
-