Record Class AllPotatoProjectileBlockHitActions.PlantCrop
java.lang.Object
java.lang.Record
com.simibubi.create.content.equipment.potatoCannon.AllPotatoProjectileBlockHitActions.PlantCrop
- All Implemented Interfaces:
PotatoProjectileBlockHitAction
- Enclosing class:
AllPotatoProjectileBlockHitActions
public static record AllPotatoProjectileBlockHitActions.PlantCrop(net.minecraft.core.Holder<net.minecraft.world.level.block.Block> cropBlock)
extends Record
implements PotatoProjectileBlockHitAction
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<AllPotatoProjectileBlockHitActions.PlantCrop> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<? extends PotatoProjectileBlockHitAction> codec()net.minecraft.core.Holder<net.minecraft.world.level.block.Block> Returns the value of thecropBlockrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanexecute(net.minecraft.world.level.LevelAccessor level, net.minecraft.world.item.ItemStack projectile, net.minecraft.world.phys.BlockHitResult ray) final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
public static final com.mojang.serialization.MapCodec<AllPotatoProjectileBlockHitActions.PlantCrop> CODEC
-
-
Constructor Details
-
PlantCrop
public PlantCrop(net.minecraft.world.level.block.Block cropBlock) -
PlantCrop
public PlantCrop(net.minecraft.core.Holder<net.minecraft.world.level.block.Block> cropBlock) Creates an instance of aPlantCroprecord class.- Parameters:
cropBlock- the value for thecropBlockrecord component
-
-
Method Details
-
execute
public boolean execute(net.minecraft.world.level.LevelAccessor level, net.minecraft.world.item.ItemStack projectile, net.minecraft.world.phys.BlockHitResult ray) - Specified by:
executein interfacePotatoProjectileBlockHitAction
-
codec
- Specified by:
codecin interfacePotatoProjectileBlockHitAction
-
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). -
cropBlock
public net.minecraft.core.Holder<net.minecraft.world.level.block.Block> cropBlock()Returns the value of thecropBlockrecord component.- Returns:
- the value of the
cropBlockrecord component
-