Package mindustry.world.blocks.payloads
Interface Payload
- All Superinterfaces:
Position
- All Known Implementing Classes:
BuildPayload
,UnitPayload
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionfloat
content()
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()
icon()
static <T extends Payload>
Tdefault 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
writes the payload for saving.static void
float
x()
float
y()
-
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.
-
write
writes the payload for saving. -
icon
TextureRegion icon()- Returns:
- icon describing the contents.
-
content
UnlockableContent content()- Returns:
- content describing this payload (block or unit)
-
getX
default float getX() -
getY
default float getY() -
write
-
read
-