Class AirHandlerItemStack
java.lang.Object
me.desht.pneumaticcraft.api.tileentity.IAirHandlerItem.Provider
me.desht.pneumaticcraft.common.capabilities.AirHandlerItemStack
- All Implemented Interfaces:
IAirHandler,IAirHandlerItem,net.minecraftforge.common.capabilities.ICapabilityProvider
-
Nested Class Summary
Nested classes/interfaces inherited from interface me.desht.pneumaticcraft.api.tileentity.IAirHandlerItem
IAirHandlerItem.Provider -
Field Summary
Fields -
Constructor Summary
Constructors -
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.<T> net.minecraftforge.common.util.LazyOptional<T>getCapability(net.minecraftforge.common.capabilities.Capability<T> cap, net.minecraft.core.Direction side) net.minecraft.world.item.ItemStackGet the itemstack container currently acted on by this air handler.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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
-
Field Details
-
AIR_NBT_KEY
- See Also:
-
-
Constructor Details
-
AirHandlerItemStack
public AirHandlerItemStack(net.minecraft.world.item.ItemStack container)
-
-
Method Details
-
getContainer
@Nonnull public net.minecraft.world.item.ItemStack getContainer()Description copied from interface:IAirHandlerItemGet the itemstack container currently acted on by this air handler. -
getPressure
public float getPressure()Description copied from interface:IAirHandlerGet the current pressure for this handler.- Returns:
- the current pressure
-
getAir
public int getAir()Description copied from interface:IAirHandlerReturns the amount of air in this handler. Note: amount of air = pressure * volume.- Returns:
- the air in this air handler
-
addAir
public void addAir(int amount) Description copied from interface:IAirHandlerAdds air to this handler.- Parameters:
amount- amount of air to add in mL, may be negative.
-
getBaseVolume
public int getBaseVolume()Description copied from interface:IAirHandlerGets 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
public void setBaseVolume(int newBaseVolume) Description copied from interface:IAirHandlerSet 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
public int getVolume()Description copied from interface:IAirHandlerGet 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
public float maxPressure()Description copied from interface:IAirHandlerGet 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
-
getCapability
@Nonnull public <T> net.minecraftforge.common.util.LazyOptional<T> getCapability(@Nonnull net.minecraftforge.common.capabilities.Capability<T> cap, @Nullable net.minecraft.core.Direction side)
-