Record Class AllPotatoProjectileEntityHitActions.PotionEffect
java.lang.Object
java.lang.Record
com.simibubi.create.content.equipment.potatoCannon.AllPotatoProjectileEntityHitActions.PotionEffect
- All Implemented Interfaces:
PotatoProjectileEntityHitAction
- Enclosing class:
AllPotatoProjectileEntityHitActions
public static record AllPotatoProjectileEntityHitActions.PotionEffect(net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect> effect, int level, int ticks, boolean recoverable)
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.PotionEffect> -
Constructor Summary
ConstructorsConstructorDescriptionPotionEffect(net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect> effect, int level, int ticks, boolean recoverable) Creates an instance of aPotionEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<? extends PotatoProjectileEntityHitAction> codec()net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect> effect()Returns the value of theeffectrecord component.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.intlevel()Returns the value of thelevelrecord component.booleanReturns the value of therecoverablerecord component.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.PotionEffect> CODEC
-
-
Constructor Details
-
PotionEffect
public PotionEffect(net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect> effect, int level, int ticks, boolean recoverable) Creates an instance of aPotionEffectrecord class.- Parameters:
effect- the value for theeffectrecord componentlevel- the value for thelevelrecord componentticks- the value for theticksrecord componentrecoverable- the value for therecoverablerecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
effect
public net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect> effect()Returns the value of theeffectrecord component.- Returns:
- the value of the
effectrecord component
-
level
public int level()Returns the value of thelevelrecord component.- Returns:
- the value of the
levelrecord component
-
ticks
public int ticks()Returns the value of theticksrecord component.- Returns:
- the value of the
ticksrecord component
-
recoverable
public boolean recoverable()Returns the value of therecoverablerecord component.- Returns:
- the value of the
recoverablerecord component
-