Interface SulfurCubeArchetypeRegistryEntry.ContactDamage

Enclosing interface:
SulfurCubeArchetypeRegistryEntry

@Experimental @NonExtendable public static interface SulfurCubeArchetypeRegistryEntry.ContactDamage
The contact damage a sulfur cube of this archetype will deal when pushed by another entity.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNegative float
    Returns the damage amount of the damage dealt.
    boolean
    Returns whether the sulfur cube of this damage should be recorded in the damage source.
    Returns the damage type of the damage dealt.
    of(TypedKey<DamageType> damageType, @NonNegative float amount, boolean attributeToSource)
    Creates a new contact damage instance based on the passed values.
  • Method Details

    • damageType

      TypedKey<DamageType> damageType()
      Returns the damage type of the damage dealt.
      Returns:
      the damage type of the damage dealt
    • amount

      @NonNegative float amount()
      Returns the damage amount of the damage dealt.
      Returns:
      the damage amount of the damage dealt
      API Note:
      for non-constant damage this will return one possible sample instead of the exact amount
    • attributeToSource

      boolean attributeToSource()
      Returns whether the sulfur cube of this damage should be recorded in the damage source.
      Returns:
      whether the sulfur cube of this damage should be recorded in the damage source
    • of

      @Contract(value="_, _, _ -> new", pure=true) static SulfurCubeArchetypeRegistryEntry.ContactDamage of(TypedKey<DamageType> damageType, @NonNegative float amount, boolean attributeToSource)
      Creates a new contact damage instance based on the passed values.
      Parameters:
      damageType - the damage type of the damage dealt, as returned by damageType()
      amount - the damage amount of the damage dealt, as returned by amount()
      attributeToSource - whether the sulfur cube of this damage should be recorded, as returned by attributeToSource()
      Returns:
      the created instance