Package mindustry.world.blocks.payloads
Interface Payload
- All Superinterfaces:
arc.math.geom.Position
- All Known Implementing Classes:
BuildPayload
,UnitPayload
public interface Payload
extends arc.math.geom.Position
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfloat
content()
default void
void
draw()
draws this payload at a position.void
drawShadow
(float alpha) default boolean
dump()
default boolean
fits
(float s) default float
getX()
default float
getY()
arc.graphics.g2d.TextureRegion
icon()
static <T extends Payload>
Tread
(arc.util.io.Reads read) default void
remove()
default float
rotation()
void
set
(float x, float y, float rotation) sets this payload's position on the map.float
size()
default void
update
(mindustry.gen.Unit unitHolder, mindustry.gen.Building buildingHolder) update this payload inside a container unit or building.void
write
(arc.util.io.Writes write) writes the payload for saving.static void
float
x()
float
y()
Methods inherited from interface arc.math.geom.Position
angleTo, angleTo, dst, dst, dst2, dst2, within, within
-
Field Details
-
payloadUnit
static final int payloadUnit- See Also:
-
payloadBlock
static final int payloadBlock- See Also:
-
-
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.
-
destroyed
default void destroyed() -
write
void write(arc.util.io.Writes write) writes the payload for saving. -
icon
arc.graphics.g2d.TextureRegion icon()- Returns:
- icon describing the contents.
-
content
UnlockableContent content()- Returns:
- content describing this payload (block or unit)
-
getX
default float getX()- Specified by:
getX
in interfacearc.math.geom.Position
-
getY
default float getY()- Specified by:
getY
in interfacearc.math.geom.Position
-
remove
default void remove() -
write
-
read
-