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 TypeMethodDescriptionfloatcontent()default voidvoiddraw()draws this payload at a position.voiddrawShadow(float alpha) default booleandump()default booleanfits(float s) default floatgetX()default floatgetY()arc.graphics.g2d.TextureRegionicon()static <T extends Payload>
Tread(arc.util.io.Reads read) default voidremove()default floatrotation()voidset(float x, float y, float rotation) sets this payload's position on the map.floatsize()default voidupdate(mindustry.gen.Unit unitHolder, mindustry.gen.Building buildingHolder) update this payload inside a container unit or building.voidwrite(arc.util.io.Writes write) writes the payload for saving.static voidfloatx()floaty()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:
getXin interfacearc.math.geom.Position
-
getY
default float getY()- Specified by:
getYin interfacearc.math.geom.Position
-
remove
default void remove() -
write
-
read
-