Class PressurizableItem

java.lang.Object
net.minecraft.world.item.Item
me.desht.pneumaticcraft.common.item.PressurizableItem
All Implemented Interfaces:
IPressurizableItem, net.minecraft.world.flag.FeatureElement, net.minecraft.world.item.Vanishable, net.minecraft.world.level.ItemLike, net.minecraftforge.common.extensions.IForgeItem
Direct Known Subclasses:
AbstractAirCanisterItem, AmadronTabletItem, CamoApplicatorItem, DroneItem, JackHammerItem, LogisticsConfiguratorItem, ManometerItem, MinigunItem, PneumaticWrenchItem, VortexCannonItem

public class PressurizableItem extends net.minecraft.world.item.Item implements IPressurizableItem, net.minecraft.world.item.Vanishable
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.world.item.Item

    net.minecraft.world.item.Item.Properties
  • Field Summary

    Fields inherited from class net.minecraft.world.item.Item

    BASE_ATTACK_DAMAGE_UUID, BASE_ATTACK_SPEED_UUID, BY_BLOCK, canRepair, EAT_DURATION, MAX_BAR_WIDTH, MAX_STACK_SIZE

    Fields inherited from interface net.minecraft.world.flag.FeatureElement

    FILTERED_REGISTRIES
  • Constructor Summary

    Constructors
    Constructor
    Description
    PressurizableItem(net.minecraft.world.item.Item.Properties props, int maxAir, int volume)
     
  • 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
    getBarColor(net.minecraft.world.item.ItemStack pStack)
     
    int
    getBarWidth(net.minecraft.world.item.ItemStack pStack)
     
    int
    Get the base item volume before any volume upgrades are added.
    int
     
    float
    Get the maximum pressure to which this item can be charged.
    net.minecraft.nbt.CompoundTag
    getShareTag(net.minecraft.world.item.ItemStack stack)
     
    int
    getVolumeUpgrades(net.minecraft.world.item.ItemStack stack)
    Get the number of volume upgrades currently in this ItemStack.
    net.minecraftforge.common.capabilities.ICapabilityProvider
    initCapabilities(net.minecraft.world.item.ItemStack stack, net.minecraft.nbt.CompoundTag nbt)
     
    boolean
    isBarVisible(net.minecraft.world.item.ItemStack pStack)
     
    boolean
    isEnchantable(net.minecraft.world.item.ItemStack stack)
     
    static net.minecraft.nbt.CompoundTag
    roundedPressure(net.minecraft.world.item.ItemStack stack)
    Get an ItemStack's NBT, rounding its air level for sync to client.
    boolean
    shouldCauseReequipAnimation(net.minecraft.world.item.ItemStack oldStack, net.minecraft.world.item.ItemStack newStack, boolean slotChanged)
     

    Methods inherited from class net.minecraft.world.item.Item

    appendHoverText, asItem, builtInRegistryHolder, byBlock, byId, canAttackBlock, canBeDepleted, canBeHurtBy, canFitInsideContainerItems, finishUsingItem, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDescription, getDescriptionId, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getFoodProperties, getId, getMaxDamage, getMaxStackSize, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getRarity, getRenderPropertiesInternal, getTooltipImage, getUseAnimation, getUseDuration, hasCraftingRemainingItem, hurtEnemy, initializeClient, interactLivingEntity, inventoryTick, isComplex, isCorrectToolForDrops, isEdible, isFireResistant, isFoil, isRepairable, isValidRepairItem, mineBlock, onCraftedBy, onDestroyed, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, releaseUsing, requiredFeatures, shouldOverrideMultiplayerNbt, toString, use, useOn, useOnRelease, verifyTagAfterLoad

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minecraft.world.flag.FeatureElement

    isEnabled

    Methods inherited from interface net.minecraftforge.common.extensions.IForgeItem

    canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canGrindstoneRepair, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getAllEnchantments, getArmorTexture, getAttributeModifiers, getBurnTime, getCraftingRemainingItem, getCreatorModId, getDamage, getDefaultTooltipHideFlags, getEnchantmentLevel, getEnchantmentValue, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getMaxDamage, getMaxStackSize, getSweepHitBox, getXpRepairRatio, hasCraftingRemainingItem, hasCustomEntity, isBookEnchantable, isCorrectToolForDrops, isDamageable, isDamaged, isEnderMask, isNotReplaceableByPickAction, isPiglinCurrency, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onItemUseFirst, onLeftClickEntity, onStopUsing, readShareTag, setDamage, shouldCauseBlockBreakReset

    Methods inherited from interface me.desht.pneumaticcraft.api.pressure.IPressurizableItem

    getEffectiveVolume, getPressure
  • Constructor Details

    • PressurizableItem

      public PressurizableItem(net.minecraft.world.item.Item.Properties props, int maxAir, int volume)
  • Method Details

    • shouldCauseReequipAnimation

      public boolean shouldCauseReequipAnimation(net.minecraft.world.item.ItemStack oldStack, net.minecraft.world.item.ItemStack newStack, boolean slotChanged)
      Specified by:
      shouldCauseReequipAnimation in interface net.minecraftforge.common.extensions.IForgeItem
    • isBarVisible

      public boolean isBarVisible(net.minecraft.world.item.ItemStack pStack)
      Overrides:
      isBarVisible in class net.minecraft.world.item.Item
    • getBarWidth

      public int getBarWidth(net.minecraft.world.item.ItemStack pStack)
      Overrides:
      getBarWidth in class net.minecraft.world.item.Item
    • getBarColor

      public int getBarColor(net.minecraft.world.item.ItemStack pStack)
      Overrides:
      getBarColor in class net.minecraft.world.item.Item
    • initCapabilities

      @Nullable public net.minecraftforge.common.capabilities.ICapabilityProvider initCapabilities(net.minecraft.world.item.ItemStack stack, @Nullable net.minecraft.nbt.CompoundTag nbt)
      Specified by:
      initCapabilities in interface net.minecraftforge.common.extensions.IForgeItem
    • getShareTag

      @Nullable public net.minecraft.nbt.CompoundTag getShareTag(net.minecraft.world.item.ItemStack stack)
      Specified by:
      getShareTag in interface net.minecraftforge.common.extensions.IForgeItem
    • getBaseVolume

      public int getBaseVolume()
      Description copied from interface: IPressurizableItem
      Get the base item volume before any volume upgrades are added.
      Specified by:
      getBaseVolume in interface IPressurizableItem
      Returns:
      the base volume
    • getVolumeUpgrades

      public int getVolumeUpgrades(net.minecraft.world.item.ItemStack stack)
      Description copied from interface: IPressurizableItem
      Get the number of volume upgrades currently in this ItemStack.
      Specified by:
      getVolumeUpgrades in interface IPressurizableItem
      Parameters:
      stack - the ItemStack to check
      Returns:
      the number of installed volume upgrades
    • getAir

      public int getAir(net.minecraft.world.item.ItemStack stack)
      Description copied from interface: IPressurizableItem
      Get the amount of air currently held in this ItemStack.
      Specified by:
      getAir in interface IPressurizableItem
      Parameters:
      stack - the ItemStack to check
      Returns:
      the amount of air, in mL
    • getMaxPressure

      public float getMaxPressure()
      Description copied from interface: IPressurizableItem
      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.
      Specified by:
      getMaxPressure in interface IPressurizableItem
      Returns:
      the maximum pressure for this item
    • isEnchantable

      public boolean isEnchantable(net.minecraft.world.item.ItemStack stack)
      Overrides:
      isEnchantable in class net.minecraft.world.item.Item
    • getEnchantmentValue

      public int getEnchantmentValue()
      Overrides:
      getEnchantmentValue in class net.minecraft.world.item.Item
    • roundedPressure

      public static net.minecraft.nbt.CompoundTag roundedPressure(net.minecraft.world.item.ItemStack stack)
      Get an ItemStack's NBT, rounding its air level for sync to client. Default precision of volume/10 is enough precision to display 1 decimal place of pressure, and will greatly reduce server->client chatter
      Parameters:
      stack - the itemstack being sync'd
      Returns:
      the item's NBT, but with the air level rounded