Record Class AllPotatoProjectileEntityHitActions.ChorusTeleport
java.lang.Object
java.lang.Record
com.simibubi.create.content.equipment.potatoCannon.AllPotatoProjectileEntityHitActions.ChorusTeleport
- All Implemented Interfaces:
PotatoProjectileEntityHitAction
- Enclosing class:
AllPotatoProjectileEntityHitActions
public static record AllPotatoProjectileEntityHitActions.ChorusTeleport(double teleportDiameter)
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.ChorusTeleport> -
Constructor Summary
ConstructorsConstructorDescriptionChorusTeleport(double teleportDiameter) Creates an instance of aChorusTeleportrecord class. -
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.doubleReturns the value of theteleportDiameterrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
public static final com.mojang.serialization.MapCodec<AllPotatoProjectileEntityHitActions.ChorusTeleport> CODEC
-
-
Constructor Details
-
ChorusTeleport
public ChorusTeleport(double teleportDiameter) Creates an instance of aChorusTeleportrecord class.- Parameters:
teleportDiameter- the value for theteleportDiameterrecord component
-
-
Method Details
-
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 '=='. -
teleportDiameter
public double teleportDiameter()Returns the value of theteleportDiameterrecord component.- Returns:
- the value of the
teleportDiameterrecord component
-