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
  • Field Details

  • 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 a PotatoCannonProjectileType record class.
      Parameters:
      items - the value for the items record component
      reloadTicks - the value for the reloadTicks record component
      damage - the value for the damage record component
      split - the value for the split record component
      knockback - the value for the knockback record component
      drag - the value for the drag record component
      velocityMultiplier - the value for the velocityMultiplier record component
      gravityMultiplier - the value for the gravityMultiplier record component
      soundPitch - the value for the soundPitch record component
      sticky - the value for the sticky record component
      dropStack - the value for the dropStack record component
      renderMode - the value for the renderMode record component
      preEntityHit - the value for the preEntityHit record component
      onEntityHit - the value for the onEntityHit record component
      onBlockHit - the value for the onBlockHit record 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 the dropStack record component.
      Returns:
      the value of the dropStack record component
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • items

      public net.minecraft.core.HolderSet<net.minecraft.world.item.Item> items()
      Returns the value of the items record component.
      Returns:
      the value of the items record component
    • reloadTicks

      public int reloadTicks()
      Returns the value of the reloadTicks record component.
      Returns:
      the value of the reloadTicks record component
    • damage

      public int damage()
      Returns the value of the damage record component.
      Returns:
      the value of the damage record component
    • split

      public int split()
      Returns the value of the split record component.
      Returns:
      the value of the split record component
    • knockback

      public float knockback()
      Returns the value of the knockback record component.
      Returns:
      the value of the knockback record component
    • drag

      public float drag()
      Returns the value of the drag record component.
      Returns:
      the value of the drag record component
    • velocityMultiplier

      public float velocityMultiplier()
      Returns the value of the velocityMultiplier record component.
      Returns:
      the value of the velocityMultiplier record component
    • gravityMultiplier

      public float gravityMultiplier()
      Returns the value of the gravityMultiplier record component.
      Returns:
      the value of the gravityMultiplier record component
    • soundPitch

      public float soundPitch()
      Returns the value of the soundPitch record component.
      Returns:
      the value of the soundPitch record component
    • sticky

      public boolean sticky()
      Returns the value of the sticky record component.
      Returns:
      the value of the sticky record component
    • renderMode

      public PotatoProjectileRenderMode renderMode()
      Returns the value of the renderMode record component.
      Returns:
      the value of the renderMode record component
    • preEntityHit

      public Optional<PotatoProjectileEntityHitAction> preEntityHit()
      Returns the value of the preEntityHit record component.
      Returns:
      the value of the preEntityHit record component
    • onEntityHit

      Returns the value of the onEntityHit record component.
      Returns:
      the value of the onEntityHit record component
    • onBlockHit

      Returns the value of the onBlockHit record component.
      Returns:
      the value of the onBlockHit record component