Interface IAirHandler
- All Known Subinterfaces:
IAirHandlerItem,IAirHandlerMachine
- All Known Implementing Classes:
AirHandlerItemStack,BasicAirHandler,IAirHandlerItem.Provider,MachineAirHandler
public interface IAirHandler
Base functionality for all air handlers. This is also used by entities which can be pressurized, e.g. drones.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAir(int amount) Adds air to this handler.intgetAir()Returns the amount of air in this handler.intGets the base volume of this handler, before any Volume Upgrades are taken into account.floatGet the current pressure for this handler.intGet the effective volume of this air handler.floatGet the maximum pressure this handler can take.voidsetBaseVolume(int newBaseVolume) Set the base volume of this air handler.
-
Method Details
-
getPressure
float getPressure()Get the current pressure for this handler.- Returns:
- the current pressure
-
getAir
int getAir()Returns the amount of air in this handler. Note: amount of air = pressure * volume.- Returns:
- the air in this air handler
-
addAir
void addAir(int amount) Adds air to this handler.- Parameters:
amount- amount of air to add in mL, may be negative.
-
getBaseVolume
int getBaseVolume()Gets the base volume of this handler, before any Volume Upgrades are taken into account. When the volume decreases, the pressure will remain the same, meaning air will be lost. When the volume increases, the air remains the same, meaning the pressure will drop.- Returns:
- the base volume
-
setBaseVolume
void setBaseVolume(int newBaseVolume) Set the base volume of this air handler. May be useful if the base volume depends on factors other than the number of volume upgrades.- Parameters:
newBaseVolume- the new base volume
-
getVolume
int getVolume()Get the effective volume of this air handler. This may have been increased by Volume Upgrades, and also other external modifiers (seeIItemRegistry.registerPneumaticVolumeModifier(ItemVolumeModifier)).- Returns:
- the effective volume, in mL
-
maxPressure
float maxPressure()Get the maximum pressure this handler can take. Behaviour when more air is added is implementation-dependent (e.g. items tend to stop accepting air, while blocks/machine tend to explode)- Returns:
- the maximum pressure for this handler
-