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 ItemModulestatic floatInterval between which samples are added to the window, in ticks.static floatVisual refresh rate of the value, in ticks.static intTotal number of samples of flow rate that are taken.protected int[]protected intprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidadd(ItemModule items) booleanany()voidcheckArrayCapacity(int size) 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
-
flowWindowSize
public static int flowWindowSizeTotal number of samples of flow rate that are taken. -
flowPollInterval
public static float flowPollIntervalInterval between which samples are added to the window, in ticks. -
flowVisualRefreshInterval
public static float flowVisualRefreshIntervalVisual refresh rate of the value, in ticks. Doesn't affect values, just reduces high-frequency flickering. -
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() -
checkArrayCapacity
public void checkArrayCapacity(int size) -
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
-