Record Class AllPotatoProjectileEntityHitActions.FoodEffects
java.lang.Object
java.lang.Record
com.simibubi.create.content.equipment.potatoCannon.AllPotatoProjectileEntityHitActions.FoodEffects
- All Implemented Interfaces:
PotatoProjectileEntityHitAction
- Enclosing class:
AllPotatoProjectileEntityHitActions
public static record AllPotatoProjectileEntityHitActions.FoodEffects(net.minecraft.world.food.FoodProperties foodProperty, 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.FoodEffects> -
Constructor Summary
ConstructorsConstructorDescriptionFoodEffects(net.minecraft.world.food.FoodProperties foodProperty, boolean recoverable) Creates an instance of aFoodEffectsrecord 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) net.minecraft.world.food.FoodPropertiesReturns the value of thefoodPropertyrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of therecoverablerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
public static final com.mojang.serialization.MapCodec<AllPotatoProjectileEntityHitActions.FoodEffects> CODEC
-
-
Constructor Details
-
FoodEffects
public FoodEffects(net.minecraft.world.food.FoodProperties foodProperty, boolean recoverable) Creates an instance of aFoodEffectsrecord class.- Parameters:
foodProperty- the value for thefoodPropertyrecord 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 '=='. -
foodProperty
public net.minecraft.world.food.FoodProperties foodProperty()Returns the value of thefoodPropertyrecord component.- Returns:
- the value of the
foodPropertyrecord component
-
recoverable
public boolean recoverable()Returns the value of therecoverablerecord component.- Returns:
- the value of the
recoverablerecord component
-