Interface IItemCompressionSequence

All Known Implementing Classes:
FinishableMapItemCompressionSequence, IItemCompressionSequence.EmptyItemCompressionSequence, NoItemCompressionSequence

public interface IItemCompressionSequence
  • Field Details

  • Method Details

    • getBaseItem

      net.minecraft.world.item.ItemStack getBaseItem()
      Get a copy of the least-compressed Item (Stack) in the sequence.
      Returns:
      ItemStack of count 1
    • getAllItems

      List<net.minecraft.world.item.ItemStack> getAllItems()
      Get the ordered list of all Item (Stacks) in this sequence.
      Returns:
      Non-null list of ItemStacks of count 1
    • size

      default int size()
      The number of Items in this sequence.
      Returns:
      Positive number
    • getAllCompressions

      List<IItemCompression> getAllCompressions()
      An ordered list of IItemCompressions, with the counts relative to the Item before (i.e. not relative to the base Item, except for the first compression).
      Returns:
      Non-null list of IItemCompressions
    • getEquivalentBaseItems

      org.apache.commons.lang3.math.Fraction getEquivalentBaseItems(net.minecraft.world.item.ItemStack stack)
      Get the number of base Items equivalent to the given Item Stack.
      Parameters:
      stack - The count of the Stack is considered
      Returns:
      null if the Item (considering its Components) are not part of this sequence
      See Also:
    • getEquivalentBaseItems

      double getEquivalentBaseItems(net.minecraft.world.item.ItemStack stack, double count)
      Get the number of base Items a given amount of the given Item.
      Parameters:
      stack - The count of this Stack is ignored
      count -
      Returns:
      0 if the Item (considering its Components) are not part of this sequence
    • getEquivalentBaseItems

      default org.apache.commons.lang3.math.Fraction getEquivalentBaseItems(int item)
      Get the number of base Items equivalent to the itemth Item (Stack) in this sequence.
      Parameters:
      item -
      Returns:
      null if item is outside the bounds of the number of Items in this sequence.
      See Also:
    • getBaseBlock

      Get the least-compressed Item which is a BlockItem.
      Returns:
      Empty Optional if there are no BlockItems in this sequence, or an Optional containing a IItemCompressionSequence.CompressedBlock containing the Block and the ItemStack pertaining to it (which is guaranteed to be in this sequence)
    • isEmpty

      default boolean isEmpty()
    • getFewestStacks

      default List<BigItemStack> getFewestStacks(long baseItemCount)
      Divide a number of base Items into the biggest possible compressed forms, producing the smallest total number of Item Stacks.
      Parameters:
      baseItemCount -