Class PressurizableItem

java.lang.Object
net.minecraft.world.item.Item
me.desht.pneumaticcraft.common.item.PressurizableItem
All Implemented Interfaces:
IPressurizableItem, 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, category, EAT_DURATION, MAX_BAR_WIDTH, MAX_STACK_SIZE
  • Constructor Summary

    Constructors
    Constructor
    Description
    PressurizableItem(net.minecraft.world.item.Item.Properties props, int maxAir, int volume)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    fillItemCategory(net.minecraft.world.item.CreativeModeTab group, net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> items)
     
    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
     
    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

    allowedIn, appendHoverText, asItem, builtInRegistryHolder, byBlock, byId, canAttackBlock, canBeDepleted, canBeHurtBy, canFitInsideContainerItems, finishUsingItem, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDescription, getDescriptionId, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getEquipSound, getFoodProperties, getId, getItemCategory, 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, 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.minecraftforge.common.extensions.IForgeItem

    canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getAllEnchantments, getArmorTexture, getAttributeModifiers, getBurnTime, getCraftingRemainingItem, getCreativeTabs, 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, onUsingTick, 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
    • fillItemCategory

      public void fillItemCategory(net.minecraft.world.item.CreativeModeTab group, net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> items)
      Overrides:
      fillItemCategory 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
    • 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