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

    Fields
    Modifier and Type
    Field
    Description
    static final com.simibubi.create.api.registry.SimpleRegistry<net.minecraft.world.level.block.Block,OxygenConsumer>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.
    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 with northstar$getOxygenConsumption(BlockGetter, BlockPos, float)
    static <B extends net.minecraft.world.level.block.Block>
    com.tterrag.registrate.util.nullness.NonNullConsumer<? super B>
     
    scaleBy(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

      static OxygenConsumer scaleBy(float usage)
    • 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 with northstar$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 block
      pos - the position of the block
      base - the base oxygen consumption, in mB/t