Class UnitPayload

java.lang.Object
mindustry.world.blocks.payloads.UnitPayload
All Implemented Interfaces:
Position, Payload

public class UnitPayload extends Object implements Payload
  • Field Details

    • overlayDuration

      public static final float overlayDuration
      See Also:
    • unit

      public mindustry.gen.Unit unit
    • overlayTime

      public float overlayTime
    • overlayRegion

      @Nullable public TextureRegion overlayRegion
  • Constructor Details

    • UnitPayload

      public UnitPayload(mindustry.gen.Unit unit)
  • Method Details

    • showOverlay

      public void showOverlay(TextureRegion icon)
      Flashes a red overlay region.
    • showOverlay

      public void showOverlay(TextureRegionDrawable icon)
      Flashes a red overlay region.
    • update

      public void update(@Nullable mindustry.gen.Unit unitHolder, @Nullable mindustry.gen.Building buildingHolder)
      Description copied from interface: Payload
      update this payload inside a container unit or building. either can be null.
      Specified by:
      update in interface Payload
    • content

      public UnlockableContent content()
      Specified by:
      content in interface Payload
      Returns:
      content describing this payload (block or unit)
    • requirements

      public ItemStack[] requirements()
      Specified by:
      requirements in interface Payload
      Returns:
      the items needed to make this payload; may be empty.
    • buildTime

      public float buildTime()
      Specified by:
      buildTime in interface Payload
      Returns:
      the time taken to build this payload.
    • write

      public void write(Writes write)
      Description copied from interface: Payload
      writes the payload for saving.
      Specified by:
      write in interface Payload
    • set

      public void set(float x, float y, float rotation)
      Description copied from interface: Payload
      sets this payload's position on the map.
      Specified by:
      set in interface Payload
    • x

      public float x()
      Specified by:
      x in interface Payload
    • y

      public float y()
      Specified by:
      y in interface Payload
    • rotation

      public float rotation()
      Specified by:
      rotation in interface Payload
      Returns:
      rotation of this payload.
    • size

      public float size()
      Specified by:
      size in interface Payload
      Returns:
      hitbox size of the payload.
    • dump

      public boolean dump()
      Specified by:
      dump in interface Payload
      Returns:
      whether this payload was dumped.
    • drawShadow

      public void drawShadow(float alpha)
      Specified by:
      drawShadow in interface Payload
    • draw

      public void draw()
      Description copied from interface: Payload
      draws this payload at a position.
      Specified by:
      draw in interface Payload
    • icon

      public TextureRegion icon()
      Specified by:
      icon in interface Payload
      Returns:
      icon describing the contents.