Interface Cloudy

All Known Implementing Classes:
CloudyArmorItem, CloudyItem, DyeableCloudyArmorItem

public interface Cloudy
Provides constants, methods, and implementations for cloudy items.

This interface handles most of the actual code required for an item's storminess value being updated automatically. It is required, however, for manual invocation of the updateStorminess(ItemStack, Entity) method, as well as new implementations for the update delta provider methods.

Since:
1.4.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Rgb
    The maximum possible item color value.
    static final Rgb
    The minimum possible item color value.
    static final String
    The NBT key used to determine and store an item stack's storminess value.
    static final String
    The translation key assigned to the item's storminess tooltip label.
  • Method Summary

    Modifier and Type
    Method
    Description
    default double
    clampStorminess(net.minecraft.item.ItemStack stack, double storminess)
    Clamps the provided storminess value within the permitted range for the given item stack.
    default void
    decreaseStorminess(net.minecraft.item.ItemStack stack, double delta)
    Decreases the given item stack's storminess value towards its maximum value by the given delta.
    double
    getDecreaseDelta(net.minecraft.item.ItemStack stack)
    Returns the given item stack's storminess decrease delta.
    double
    getIncreaseDelta(net.minecraft.item.ItemStack stack)
    Returns the given item stack's storminess increase delta.
    default double
    getMaxStorminess(net.minecraft.item.ItemStack stack)
    Returns this item's maximum storminess value for the given item stack.
    default double
    getMinStorminess(net.minecraft.item.ItemStack stack)
    Returns this item's minimum storminess value for the given item stack.
    default double
    getStorminess(net.minecraft.item.ItemStack stack)
    Returns the given item stack's storminess value.
    default int
    getStorminessColor(net.minecraft.item.ItemStack stack)
    Returns the given item stack's storminess color.
    default net.minecraft.text.Text
    getStorminessText(net.minecraft.item.ItemStack stack)
    Returns the given item stack's storminess tooltip text.
    default void
    increaseStorminess(net.minecraft.item.ItemStack stack, double delta)
    Increases the given item stack's storminess value towards its maximum value by the given delta.
    default void
    setStorminess(net.minecraft.item.ItemStack stack, double storminess)
    Sets the given item stack's storminess value.
    default void
    updateStorminess(net.minecraft.item.ItemStack stack, net.minecraft.entity.Entity entity)
    Updates the item stack's storminess value depending on environmental conditions.
    default void
    updateStorminess(net.minecraft.item.ItemStack stack, net.minecraft.entity.Entity entity, double increaseDelta, double decreaseDelta)
    Updates the item stack's storminess value depending on environmental conditions.
  • Field Details

    • STORMINESS_KEY

      static final String STORMINESS_KEY
      The NBT key used to determine and store an item stack's storminess value.
      Since:
      1.4.0
      See Also:
    • STORMINESS_LABEL_KEY

      static final String STORMINESS_LABEL_KEY
      The translation key assigned to the item's storminess tooltip label.

      This will be the equivalent of "text.astral.storminess"

      Since:
      1.4.0
    • COLOR_MIN

      static final Rgb COLOR_MIN
      The minimum possible item color value.
      Since:
      1.4.0
    • COLOR_MAX

      static final Rgb COLOR_MAX
      The maximum possible item color value.
      Since:
      1.4.0
  • Method Details

    • setStorminess

      default void setStorminess(net.minecraft.item.ItemStack stack, double storminess)
      Sets the given item stack's storminess value.
      Parameters:
      stack - The item stack.
      storminess - The storminess level.
      Since:
      1.4.0
    • getStorminessColor

      default int getStorminessColor(net.minecraft.item.ItemStack stack)
      Returns the given item stack's storminess color.
      Parameters:
      stack - The item stack.
      Returns:
      The sRGB color as an integer.
      Since:
      1.4.0
    • getStorminess

      default double getStorminess(net.minecraft.item.ItemStack stack)
      Returns the given item stack's storminess value.
      Parameters:
      stack - The item stack.
      Returns:
      The storminess value.
      Since:
      1.4.0
    • getMinStorminess

      default double getMinStorminess(net.minecraft.item.ItemStack stack)
      Returns this item's minimum storminess value for the given item stack.
      Parameters:
      stack - The item stack.
      Returns:
      The lowest possible value.
      Since:
      1.4.0
    • getMaxStorminess

      default double getMaxStorminess(net.minecraft.item.ItemStack stack)
      Returns this item's maximum storminess value for the given item stack.
      Parameters:
      stack - The item stack.
      Returns:
      The highest possible value.
      Since:
      1.4.0
    • clampStorminess

      default double clampStorminess(net.minecraft.item.ItemStack stack, double storminess)
      Clamps the provided storminess value within the permitted range for the given item stack.
      Parameters:
      stack - The item stack.
      storminess - The storminess value.
      Returns:
      The clamped storminess value.
      Since:
      1.4.0
    • getStorminessText

      default net.minecraft.text.Text getStorminessText(net.minecraft.item.ItemStack stack)
      Returns the given item stack's storminess tooltip text.
      Parameters:
      stack - The item stack.
      Returns:
      The tooltip text.
      Since:
      1.4.0
    • getIncreaseDelta

      double getIncreaseDelta(net.minecraft.item.ItemStack stack)
      Returns the given item stack's storminess increase delta.

      This controls the rate at which a given item's storminess value is increased.

      Parameters:
      stack - The item stack.
      Returns:
      The increase delta.
      Since:
      2.0.0
    • getDecreaseDelta

      double getDecreaseDelta(net.minecraft.item.ItemStack stack)
      Returns the given item stack's storminess decrease delta.

      This controls the rate at which a given item's storminess value is decreased.

      Parameters:
      stack - The item stack.
      Returns:
      The decrease delta.
      Since:
      2.0.0
    • increaseStorminess

      default void increaseStorminess(net.minecraft.item.ItemStack stack, double delta)
      Increases the given item stack's storminess value towards its maximum value by the given delta.
      Parameters:
      stack - The item stack.
      delta - The amount of change.
      Since:
      1.4.0
    • decreaseStorminess

      default void decreaseStorminess(net.minecraft.item.ItemStack stack, double delta)
      Decreases the given item stack's storminess value towards its maximum value by the given delta.
      Parameters:
      stack - The item stack.
      delta - The amount of change.
      Since:
      1.4.0
    • updateStorminess

      default void updateStorminess(net.minecraft.item.ItemStack stack, net.minecraft.entity.Entity entity, double increaseDelta, double decreaseDelta)
      Updates the item stack's storminess value depending on environmental conditions.
      Parameters:
      stack - The item stack.
      entity - The entity holding the stack.
      increaseDelta - The delta used in increaseStorminess(ItemStack, double).
      decreaseDelta - The delta used in decreaseStorminess(ItemStack, double).
      Since:
      1.4.0
    • updateStorminess

      default void updateStorminess(net.minecraft.item.ItemStack stack, net.minecraft.entity.Entity entity)
      Updates the item stack's storminess value depending on environmental conditions.

      This simply invokes the overloaded updateStorminess(ItemStack, Entity, double, double) method, with delta values determined by this value's getIncreaseDelta(ItemStack) and getDecreaseDelta(ItemStack) methods.

      Parameters:
      stack - The item stack.
      entity - The entity holding the stack.
      Since:
      2.0.0