Record Class PotatoCannonProjectileType
java.lang.Object
java.lang.Record
com.simibubi.create.api.equipment.potatoCannon.PotatoCannonProjectileType
public record PotatoCannonProjectileType(net.minecraft.core.HolderSet<net.minecraft.world.item.Item> items, int reloadTicks, int damage, int split, float knockback, float drag, float velocityMultiplier, float gravityMultiplier, float soundPitch, boolean sticky, net.minecraft.world.item.ItemStack dropStack, PotatoProjectileRenderMode renderMode, Optional<PotatoProjectileEntityHitAction> preEntityHit, Optional<PotatoProjectileEntityHitAction> onEntityHit, Optional<PotatoProjectileBlockHitAction> onBlockHit)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<PotatoCannonProjectileType> -
Constructor Summary
ConstructorsConstructorDescriptionPotatoCannonProjectileType(net.minecraft.core.HolderSet<net.minecraft.world.item.Item> items, int reloadTicks, int damage, int split, float knockback, float drag, float velocityMultiplier, float gravityMultiplier, float soundPitch, boolean sticky, net.minecraft.world.item.ItemStack dropStack, PotatoProjectileRenderMode renderMode, Optional<PotatoProjectileEntityHitAction> preEntityHit, Optional<PotatoProjectileEntityHitAction> onEntityHit, Optional<PotatoProjectileBlockHitAction> onBlockHit) Creates an instance of aPotatoCannonProjectileTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptionintdamage()Returns the value of thedamagerecord component.floatdrag()Returns the value of thedragrecord component.net.minecraft.world.item.ItemStackReturns the value of thedropStackrecord component.final booleanIndicates whether some other object is "equal to" this one.static Optional<net.minecraft.core.Holder.Reference<PotatoCannonProjectileType>> getTypeForItem(net.minecraft.core.RegistryAccess registryAccess, net.minecraft.world.item.Item item) floatReturns the value of thegravityMultiplierrecord component.final inthashCode()Returns a hash code value for this object.net.minecraft.core.HolderSet<net.minecraft.world.item.Item> items()Returns the value of theitemsrecord component.floatReturns the value of theknockbackrecord component.Returns the value of theonBlockHitrecord component.booleanonBlockHit(net.minecraft.world.level.LevelAccessor level, net.minecraft.world.item.ItemStack stack, net.minecraft.world.phys.BlockHitResult ray) Returns the value of theonEntityHitrecord component.booleanonEntityHit(net.minecraft.world.item.ItemStack stack, net.minecraft.world.phys.EntityHitResult ray) Returns the value of thepreEntityHitrecord component.booleanpreEntityHit(net.minecraft.world.item.ItemStack stack, net.minecraft.world.phys.EntityHitResult ray) intReturns the value of thereloadTicksrecord component.Returns the value of therenderModerecord component.floatReturns the value of thesoundPitchrecord component.intsplit()Returns the value of thesplitrecord component.booleansticky()Returns the value of thestickyrecord component.final StringtoString()Returns a string representation of this record class.floatReturns the value of thevelocityMultiplierrecord component.
-
Field Details
-
CODEC
-
-
Constructor Details
-
PotatoCannonProjectileType
public PotatoCannonProjectileType(net.minecraft.core.HolderSet<net.minecraft.world.item.Item> items, int reloadTicks, int damage, int split, float knockback, float drag, float velocityMultiplier, float gravityMultiplier, float soundPitch, boolean sticky, net.minecraft.world.item.ItemStack dropStack, PotatoProjectileRenderMode renderMode, Optional<PotatoProjectileEntityHitAction> preEntityHit, Optional<PotatoProjectileEntityHitAction> onEntityHit, Optional<PotatoProjectileBlockHitAction> onBlockHit) Creates an instance of aPotatoCannonProjectileTyperecord class.- Parameters:
items- the value for theitemsrecord componentreloadTicks- the value for thereloadTicksrecord componentdamage- the value for thedamagerecord componentsplit- the value for thesplitrecord componentknockback- the value for theknockbackrecord componentdrag- the value for thedragrecord componentvelocityMultiplier- the value for thevelocityMultiplierrecord componentgravityMultiplier- the value for thegravityMultiplierrecord componentsoundPitch- the value for thesoundPitchrecord componentsticky- the value for thestickyrecord componentdropStack- the value for thedropStackrecord componentrenderMode- the value for therenderModerecord componentpreEntityHit- the value for thepreEntityHitrecord componentonEntityHit- the value for theonEntityHitrecord componentonBlockHit- the value for theonBlockHitrecord component
-
-
Method Details
-
getTypeForItem
public static Optional<net.minecraft.core.Holder.Reference<PotatoCannonProjectileType>> getTypeForItem(net.minecraft.core.RegistryAccess registryAccess, net.minecraft.world.item.Item item) -
preEntityHit
public boolean preEntityHit(net.minecraft.world.item.ItemStack stack, net.minecraft.world.phys.EntityHitResult ray) -
onEntityHit
public boolean onEntityHit(net.minecraft.world.item.ItemStack stack, net.minecraft.world.phys.EntityHitResult ray) -
onBlockHit
public boolean onBlockHit(net.minecraft.world.level.LevelAccessor level, net.minecraft.world.item.ItemStack stack, net.minecraft.world.phys.BlockHitResult ray) -
dropStack
public net.minecraft.world.item.ItemStack dropStack()Returns the value of thedropStackrecord component.- Returns:
- the value of the
dropStackrecord component
-
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 '=='. -
items
public net.minecraft.core.HolderSet<net.minecraft.world.item.Item> items()Returns the value of theitemsrecord component.- Returns:
- the value of the
itemsrecord component
-
reloadTicks
public int reloadTicks()Returns the value of thereloadTicksrecord component.- Returns:
- the value of the
reloadTicksrecord component
-
damage
public int damage()Returns the value of thedamagerecord component.- Returns:
- the value of the
damagerecord component
-
split
public int split()Returns the value of thesplitrecord component.- Returns:
- the value of the
splitrecord component
-
knockback
public float knockback()Returns the value of theknockbackrecord component.- Returns:
- the value of the
knockbackrecord component
-
drag
public float drag()Returns the value of thedragrecord component.- Returns:
- the value of the
dragrecord component
-
velocityMultiplier
public float velocityMultiplier()Returns the value of thevelocityMultiplierrecord component.- Returns:
- the value of the
velocityMultiplierrecord component
-
gravityMultiplier
public float gravityMultiplier()Returns the value of thegravityMultiplierrecord component.- Returns:
- the value of the
gravityMultiplierrecord component
-
soundPitch
public float soundPitch()Returns the value of thesoundPitchrecord component.- Returns:
- the value of the
soundPitchrecord component
-
sticky
public boolean sticky()Returns the value of thestickyrecord component.- Returns:
- the value of the
stickyrecord component
-
renderMode
Returns the value of therenderModerecord component.- Returns:
- the value of the
renderModerecord component
-
preEntityHit
Returns the value of thepreEntityHitrecord component.- Returns:
- the value of the
preEntityHitrecord component
-
onEntityHit
Returns the value of theonEntityHitrecord component.- Returns:
- the value of the
onEntityHitrecord component
-
onBlockHit
Returns the value of theonBlockHitrecord component.- Returns:
- the value of the
onBlockHitrecord component
-