Interface IAirListener

All Known Implementing Classes:
AdvancedPressureTubeBlockEntity, PressureChamberValveBlockEntity, PressureTubeBlockEntity, ReinforcedPressureTubeBlockEntity

public interface IAirListener
Optionally implement this in your TileEntity to gain extra control over pneumatic behaviour. These methods will be called by the IAirHandlerMachine implementation when it is ticked. Note that all of these methods have default "no-op" implementations, so override the ones you need to.
  • Method Summary

    Modifier and Type
    Method
    Description
    With this method, you can add neighbouring air handlers that aren't physically adjacent, but should be considered connected for air dispersion logic.
    default int
    getMaxDispersion(IAirHandlerMachine handler, net.minecraft.core.Direction dir)
    Method fired to get the maximum amount of air allowed to disperse to the given direction.
    default void
    onAirDispersion(IAirHandlerMachine handler, net.minecraft.core.Direction dir, int airDispersed)
    Called when air is added to, or removed from a handler, dispersed into/from a certain direction.
  • Method Details

    • onAirDispersion

      default void onAirDispersion(IAirHandlerMachine handler, @Nullable net.minecraft.core.Direction dir, int airDispersed)
      Called when air is added to, or removed from a handler, dispersed into/from a certain direction. Used by the Flow Detector Module, for example.
      Parameters:
      handler - the air handler in question
      dir - the direction of air dispersal
      airDispersed - the amount of air dispersed to the neighbouring handler (negative when air is being added to this handler)
    • getMaxDispersion

      default int getMaxDispersion(IAirHandlerMachine handler, @Nullable net.minecraft.core.Direction dir)
      Method fired to get the maximum amount of air allowed to disperse to the given direction. Used in the Regulator Tube Module, for example, to limit air flow.
      Parameters:
      handler - the air handler in question
      dir - the direction of dispersal
      Returns:
      the max amount of air which may be dispersed this tick (return Integer.MAX_VALUE to have no limit)
    • addConnectedPneumatics

      default List<IAirHandlerMachine> addConnectedPneumatics(List<IAirHandlerMachine> airHandlers)
      With this method, you can add neighbouring air handlers that aren't physically adjacent, but should be considered connected for air dispersion logic. Used in Pressure Chamber Valves, for example, to make them connect when they are part of the same Pressure Chamber.
      Parameters:
      airHandlers - add extra connected air handlers to this list
      Returns:
      the supplied list, for convenience