Interface IPressurizableItem

All Known Implementing Classes:
AbstractAirCanisterItem, AbstractAirCanisterItem.Basic, AbstractAirCanisterItem.Reinforced, AmadronTabletItem, CamoApplicatorItem, DroneItem, JackHammerItem, LogisticsConfiguratorItem, ManometerItem, MinigunItem, PneumaticArmorItem, PneumaticWrenchItem, PressurizableItem, VortexCannonItem

public interface IPressurizableItem
Convenience interface; if your item implements this, you can take advantage of PneumaticCraft's built-in item air handling functionality, while providing the IAirHandlerItem capability to access the item's air information.

You don't have to implement this interface in your air-handling items, but it will make things easier; the alternative is to provide a custom implementation of IAirHandlerItem for your capability, which is more work.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    getAir(net.minecraft.world.item.ItemStack stack)
    Get the amount of air currently held in this ItemStack.
    int
    Get the base item volume before any volume upgrades are added.
    default int
    getEffectiveVolume(net.minecraft.world.item.ItemStack stack)
    The effective volume is the item's base volume, modified by both the volume upgrades installed in the item, and any extra registered modifiers (e.g.
    float
    Get the maximum pressure to which this item can be charged.
    default float
    getPressure(net.minecraft.world.item.ItemStack stack)
    Get the pressure for this item.
    int
    getVolumeUpgrades(net.minecraft.world.item.ItemStack stack)
    Get the number of volume upgrades currently in this ItemStack.
  • Method Details

    • getBaseVolume

      int getBaseVolume()
      Get the base item volume before any volume upgrades are added.
      Returns:
      the base volume
    • getVolumeUpgrades

      int getVolumeUpgrades(net.minecraft.world.item.ItemStack stack)
      Get the number of volume upgrades currently in this ItemStack.
      Parameters:
      stack - the ItemStack to check
      Returns:
      the number of installed volume upgrades
    • getAir

      int getAir(net.minecraft.world.item.ItemStack stack)
      Get the amount of air currently held in this ItemStack.
      Parameters:
      stack - the ItemStack to check
      Returns:
      the amount of air, in mL
    • getMaxPressure

      float getMaxPressure()
      Get the maximum pressure to which this item can be charged. Note that items (unlike machines) don't tend to explode when they reach their pressure limit; they just stop charging.
      Returns:
      the maximum pressure for this item
    • getEffectiveVolume

      default int getEffectiveVolume(net.minecraft.world.item.ItemStack stack)
      The effective volume is the item's base volume, modified by both the volume upgrades installed in the item, and any extra registered modifiers (e.g. CoFH Holding enchantment).
      Parameters:
      stack - the ItemStack to check
      Returns:
      the effective, final, volume to use
    • getPressure

      default float getPressure(net.minecraft.world.item.ItemStack stack)
      Get the pressure for this item. This is simply the air in the item, divided by the effective volume of the item.
      Parameters:
      stack - the ItemStack to check
      Returns:
      the item's current pressure, in bar