Package mindustry.world.consumers
Class Consume
java.lang.Object
mindustry.world.consumers.Consume
- Direct Known Subclasses:
ConsumeItemDynamic
,ConsumeItemFilter
,ConsumeItems
,ConsumeLiquidBase
,ConsumeLiquids
,ConsumeLiquidsDynamic
,ConsumePayloadDynamic
,ConsumePayloadFilter
,ConsumePayloads
,ConsumePower
An abstract class that defines a type of resource that a block can consume.
-
Field Summary
Modifier and TypeFieldDescriptionboolean
If true, this consumer will be displayed as a boost input.Floatf<mindustry.gen.Building>
Multiplier for costs.boolean
If true, this consumer will not influence consumer validity.boolean
If false, this consumer will still be checked, but it will need to updated manually. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Apply extra filters to a block.boost()
void
void
float
efficiency
(mindustry.gen.Building build) float
efficiencyMultiplier
(mindustry.gen.Building build) boolean
ignore()
optional
(boolean optional, boolean boost) void
trigger
(mindustry.gen.Building build) Called when a consumption is triggered manually.update
(boolean update) void
update
(mindustry.gen.Building build)
-
Field Details
-
optional
public boolean optionalIf true, this consumer will not influence consumer validity. -
booster
public boolean boosterIf true, this consumer will be displayed as a boost input. -
update
public boolean updateIf false, this consumer will still be checked, but it will need to updated manually. -
multiplier
Multiplier for costs. Does not work for power consumers.
-
-
Constructor Details
-
Consume
public Consume()
-
-
Method Details
-
apply
Apply extra filters to a block. -
optional
-
boost
-
update
-
ignore
public boolean ignore()- Returns:
- if true, this consumer will be ignored in the consumer list (no updates or valid() checks)
-
build
-
trigger
public void trigger(mindustry.gen.Building build) Called when a consumption is triggered manually. -
update
public void update(mindustry.gen.Building build) -
efficiency
public float efficiency(mindustry.gen.Building build) - Returns:
- [0, 1] efficiency multiplier based on input. Returns 0 if not valid in subclasses. Should return fraction if needs are partially met.
-
efficiencyMultiplier
public float efficiencyMultiplier(mindustry.gen.Building build) - Returns:
- multiplier for efficiency - this can be above 1. Will not influence a building's base efficiency value.
-
display
-