Interface OxygenConsumer
- All Known Implementing Classes:
AbstractFurnaceBlockMixin,AirIntakeBlockMixin,BackTankBlockMixin,BaseFireBlockMixin,BlazeBurnerBlockMixin,CampfireBlockMixin,CombustionEngineBlock,DieselEngineBlockMixin,ExhaustBlockMixin,LeavesBlockMixin
@ParametersAreNonnullByDefault
public interface OxygenConsumer
Oxygen consumers are blocks that may consume oxygen at different rates. The interface can either be implemented onto
the block instance directly or implementations can be associated to existing blocks via
REGISTRY.
Note that the block must be counted as part of the sealed volume for it to interact, this can be done by
adding the block to the northstar:blocks_air tag or implementing SealableBlock.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.simibubi.create.api.registry.SimpleRegistry<net.minecraft.world.level.block.Block, OxygenConsumer> -
Method Summary
Modifier and TypeMethodDescriptionfloatnorthstar$getOxygenConsumption(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, float base) Calculates the oxygen usage in mB/t Note for implementers: if dynamic, make sure that the block is what you expect as it might change in the world and seals don't update instantly.default booleannorthstar$isGogglesOnly(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos) Tests if this consumer should be displayed on goggles but not actually affect oxygen sealers.default booleannorthstar$isOxygenConsumptionDynamic(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos) Tests if the oxygen consumption is dynamic and should be checked each tick, if false then the consumption is only checked once on seal updates withnorthstar$getOxygenConsumption(BlockGetter, BlockPos, float)static <B extends net.minecraft.world.level.block.Block>
com.tterrag.registrate.util.nullness.NonNullConsumer<? super B> oxygenConsumer(OxygenConsumer consumer) static OxygenConsumerscaleBy(float usage)
-
Field Details
-
REGISTRY
static final com.simibubi.create.api.registry.SimpleRegistry<net.minecraft.world.level.block.Block,OxygenConsumer> REGISTRY
-
-
Method Details
-
oxygenConsumer
static <B extends net.minecraft.world.level.block.Block> com.tterrag.registrate.util.nullness.NonNullConsumer<? super B> oxygenConsumer(OxygenConsumer consumer) -
scaleBy
-
northstar$isGogglesOnly
default boolean northstar$isGogglesOnly(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos) Tests if this consumer should be displayed on goggles but not actually affect oxygen sealers. -
northstar$isOxygenConsumptionDynamic
default boolean northstar$isOxygenConsumptionDynamic(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos) Tests if the oxygen consumption is dynamic and should be checked each tick, if false then the consumption is only checked once on seal updates withnorthstar$getOxygenConsumption(BlockGetter, BlockPos, float)- Returns:
- true if the block might change its oxygen consumption and needs to be checked each tick
-
northstar$getOxygenConsumption
float northstar$getOxygenConsumption(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, float base) Calculates the oxygen usage in mB/t Note for implementers: if dynamic, make sure that the block is what you expect as it might change in the world and seals don't update instantly.- Parameters:
level- the level of the blockpos- the position of the blockbase- the base oxygen consumption, in mB/t
-