Package mindustry.world.modules
Class ItemModule
java.lang.Object
mindustry.world.modules.BlockModule
mindustry.world.modules.ItemModule
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ItemModuleprotected int[]protected intprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidadd(ItemModule items) booleanany()voidclear()copy()voideach(ItemModule.ItemConsumer cons) booleanempty()first()intget(int id) intfloatgetFlowRate(Item item) voidhandleFlow(Item item, int amount) booleanhas(int id) booleanbooleanbooleanbooleanbooleanbooleanbooleanhasFlowItem(Item item) booleanReturns true if this entity has at least one of each item in each stack.intlength()voidread(arc.util.io.Reads read, boolean legacy) voidvoidvoidvoidvoidvoidvoidset(ItemModule other) voidstopFlow()floatsum(ItemModule.ItemCalculator calc) take()toString()inttotal()voidvoidvoidwrite(arc.util.io.Writes write) Methods inherited from class mindustry.world.modules.BlockModule
read
-
Field Details
-
empty
-
items
protected int[] items -
total
protected int total -
takeRotation
protected int takeRotation
-
-
Constructor Details
-
ItemModule
public ItemModule()
-
-
Method Details
-
copy
-
set
-
updateFlow
public void updateFlow() -
stopFlow
public void stopFlow() -
length
public int length() -
getFlowRate
- Returns:
- a specific item's flow rate in items/s; any value < 0 means not ready.
-
hasFlowItem
-
each
-
sum
-
has
public boolean has(int id) -
has
-
has
-
has
-
has
-
has
-
has
-
hasOne
Returns true if this entity has at least one of each item in each stack. -
empty
public boolean empty() -
total
public int total() -
any
public boolean any() -
first
-
take
-
get
public int get(int id) -
get
-
set
-
add
-
add
-
add
-
add
-
handleFlow
-
undoFlow
-
remove
-
remove
-
remove
-
remove
-
remove
-
clear
public void clear() -
write
public void write(arc.util.io.Writes write) - Specified by:
writein classBlockModule
-
read
public void read(arc.util.io.Reads read, boolean legacy) - Overrides:
readin classBlockModule
-
toString
-