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

public class AirHandlerItemStack extends IAirHandlerItem.Provider
  • Nested Class Summary

    Nested classes/interfaces inherited from interface me.desht.pneumaticcraft.api.tileentity.IAirHandlerItem

    IAirHandlerItem.Provider
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    AirHandlerItemStack(net.minecraft.world.item.ItemStack container, float maxPressure)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAir(int amount)
    Adds air to this handler.
    int
    Returns the amount of air in this handler.
    int
    Gets 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.ItemStack
    Get the itemstack container currently acted on by this air handler.
    float
    Get the current pressure for this handler.
    int
    Get the effective volume of this air handler.
    float
    Get the maximum pressure this handler can take.
    void
    setBaseVolume(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, wait

    Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider

    getCapability
  • Field Details

  • Constructor Details

    • AirHandlerItemStack

      public AirHandlerItemStack(net.minecraft.world.item.ItemStack container, float maxPressure)
  • Method Details

    • getContainer

      @Nonnull public net.minecraft.world.item.ItemStack getContainer()
      Description copied from interface: IAirHandlerItem
      Get the itemstack container currently acted on by this air handler.
    • getPressure

      public float getPressure()
      Description copied from interface: IAirHandler
      Get the current pressure for this handler.
      Returns:
      the current pressure
    • getAir

      public int getAir()
      Description copied from interface: IAirHandler
      Returns 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: IAirHandler
      Adds air to this handler.
      Parameters:
      amount - amount of air to add in mL, may be negative.
    • getBaseVolume

      public int getBaseVolume()
      Description copied from interface: IAirHandler
      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

      public void setBaseVolume(int newBaseVolume)
      Description copied from interface: IAirHandler
      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

      public int getVolume()
      Description copied from interface: IAirHandler
      Get the effective volume of this air handler. This may have been increased by Volume Upgrades, and also other external modifiers (see IItemRegistry.registerPneumaticVolumeModifier(ItemVolumeModifier)).
      Returns:
      the effective volume, in mL
    • maxPressure

      public float maxPressure()
      Description copied from interface: IAirHandler
      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
    • 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)