Class ItemModule

java.lang.Object
mindustry.world.modules.BlockModule
mindustry.world.modules.ItemModule

public class ItemModule extends BlockModule
  • Field Details

    • empty

      public static final ItemModule empty
    • items

      protected int[] items
    • total

      protected int total
    • takeRotation

      protected int takeRotation
  • Constructor Details

    • ItemModule

      public ItemModule()
  • Method Details

    • copy

      public ItemModule copy()
    • set

      public void set(ItemModule other)
    • updateFlow

      public void updateFlow()
    • stopFlow

      public void stopFlow()
    • length

      public int length()
    • getFlowRate

      public float getFlowRate(Item item)
      Returns:
      a specific item's flow rate in items/s; any value < 0 means not ready.
    • hasFlowItem

      public boolean hasFlowItem(Item item)
    • each

      public void each(ItemModule.ItemConsumer cons)
    • sum

      public float sum(ItemModule.ItemCalculator calc)
    • has

      public boolean has(int id)
    • has

      public boolean has(Item item)
    • has

      public boolean has(Item item, int amount)
    • has

      public boolean has(ItemStack[] stacks)
    • has

      public boolean has(ItemSeq items)
    • has

      public boolean has(Iterable<ItemStack> stacks)
    • has

      public boolean has(ItemStack[] stacks, float multiplier)
    • hasOne

      public boolean hasOne(ItemStack[] stacks)
      Returns true if this entity has at least one of each item in each stack.
    • empty

      public boolean empty()
    • total

      public int total()
    • any

      public boolean any()
    • first

      @Nullable public Item first()
    • take

      @Nullable public Item take()
    • takeIndex

      @Nullable public Item takeIndex(int takeRotation)
      Begins a speculative take operation. This returns the item that would be returned by #take(), but does not change state.
    • nextIndex

      public int nextIndex(int takeRotation)
    • get

      public int get(int id)
    • get

      public int get(Item item)
    • set

      public void set(Item item, int amount)
    • add

      public void add(Iterable<ItemStack> stacks)
    • add

      public void add(ItemSeq stacks)
    • add

      public void add(ItemModule items)
    • add

      public void add(Item item, int amount)
    • handleFlow

      public void handleFlow(Item item, int amount)
    • undoFlow

      public void undoFlow(Item item)
    • remove

      public void remove(Item item, int amount)
    • remove

      public void remove(ItemStack[] stacks)
    • remove

      public void remove(ItemSeq stacks)
    • remove

      public void remove(Iterable<ItemStack> stacks)
    • remove

      public void remove(ItemStack stack)
    • clear

      public void clear()
    • write

      public void write(Writes write)
      Specified by:
      write in class BlockModule
    • read

      public void read(Reads read, boolean legacy)
      Overrides:
      read in class BlockModule
    • toString

      public String toString()
      Overrides:
      toString in class Object