Class ProgressData

java.lang.Object
mcp.mobius.waila.api.data.ProgressData
All Implemented Interfaces:
IData

@NonExtendable public abstract class ProgressData extends Object implements IData
Adds a crafting progress information to an object.
  • Field Details

  • Constructor Details

    • ProgressData

      public ProgressData()
  • Method Details

    • ratio

      public static ProgressData ratio(float ratio)
      Creates a progress data.

      Do NOT add a data if the current progress is zero.

      Parameters:
      ratio - the ratio of the progress ranging from 0.0f to 1.0f
    • input

      public ProgressData input(ItemStack stack)
      Adds an item stack to the input list.
    • input

      public ProgressData input(ItemStack... stacks)
      Adds item stacks to the input list.
    • input

      public ProgressData input(Collection<ItemStack> stacks)
      Adds item stacks to the input list.
    • input

      public ProgressData input(int slot)
      Adds an item stack from the specified slot to the input list.

      A stack getter needs to be specified with itemGetter(IntFunction).

    • input

      public ProgressData input(int... slots)
      Adds an item stack from the specified slots to the input list.

      A stack getter needs to be specified with itemGetter(IntFunction).

    • output

      public ProgressData output(ItemStack stack)
      Adds an item stack to the output list.
    • output

      public ProgressData output(ItemStack... stacks)
      Adds item stacks to the output list.
    • output

      public ProgressData output(Collection<ItemStack> stacks)
      Adds item stacks to the output list.
    • output

      public ProgressData output(int slot)
      Adds an item stack from the specified slot to the output list.

      A stack getter needs to be specified with itemGetter(IntFunction).

    • output

      public ProgressData output(int... slots)
      Adds an item stack from the specified slots to the output list.

      A stack getter needs to be specified with itemGetter(IntFunction).

    • itemGetter

      public ProgressData itemGetter(IntFunction<ItemStack> inventory)
      Specify a slot to item stack getter to be used with input(int) and output(int).
    • ensureInputSpace

      public ProgressData ensureInputSpace(int length)
      Ensure the internal list has empty space for the specified amount.
    • ensureOutputSpace

      public ProgressData ensureOutputSpace(int length)
      Ensure the internal list has empty space for the specified amount.