Interface Payload

All Superinterfaces:
Position
All Known Implementing Classes:
BuildPayload, UnitPayload

public interface Payload extends Position
  • Field Details

  • Method Details

    • set

      void set(float x, float y, float rotation)
      sets this payload's position on the map.
    • draw

      void draw()
      draws this payload at a position.
    • drawShadow

      void drawShadow(float alpha)
    • size

      float size()
      Returns:
      hitbox size of the payload.
    • x

      float x()
    • y

      float y()
    • requirements

      ItemStack[] requirements()
      Returns:
      the items needed to make this payload; may be empty.
    • buildTime

      float buildTime()
      Returns:
      the time taken to build this payload.
    • update

      default void update(@Nullable mindustry.gen.Unit unitHolder, @Nullable mindustry.gen.Building buildingHolder)
      update this payload inside a container unit or building. either can be null.
    • dump

      default boolean dump()
      Returns:
      whether this payload was dumped.
    • fits

      default boolean fits(float s)
      Returns:
      whether this payload fits in a given size. 3 is the max for a standard 3x3 conveyor.
    • rotation

      default float rotation()
      Returns:
      rotation of this payload.
    • write

      void write(Writes write)
      writes the payload for saving.
    • icon

      Returns:
      icon describing the contents.
    • content

      Returns:
      content describing this payload (block or unit)
    • getX

      default float getX()
      Specified by:
      getX in interface Position
    • getY

      default float getY()
      Specified by:
      getY in interface Position
    • write

      static void write(@Nullable Payload payload, Writes write)
    • read

      @Nullable static <T extends Payload> T read(Reads read)