Class PressurizableItem
java.lang.Object
net.minecraftforge.registries.ForgeRegistryEntry<net.minecraft.world.item.Item>
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,net.minecraftforge.registries.IForgeRegistryEntry<net.minecraft.world.item.Item>
- 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.PropertiesNested classes/interfaces inherited from class net.minecraftforge.registries.ForgeRegistryEntry
net.minecraftforge.registries.ForgeRegistryEntry.UncheckedRegistryEntry<V extends net.minecraftforge.registries.IForgeRegistryEntry<V>> -
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_SIZEFields inherited from class net.minecraftforge.registries.ForgeRegistryEntry
delegate -
Constructor Summary
ConstructorsConstructorDescriptionPressurizableItem(net.minecraft.world.item.Item.Properties props, int maxAir, int volume) -
Method Summary
Modifier and TypeMethodDescriptionvoidfillItemCategory(net.minecraft.world.item.CreativeModeTab group, net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> items) intgetAir(net.minecraft.world.item.ItemStack stack) Get the amount of air currently held in this ItemStack.intgetBarColor(net.minecraft.world.item.ItemStack pStack) intgetBarWidth(net.minecraft.world.item.ItemStack pStack) intGet the base item volume before any volume upgrades are added.intnet.minecraft.nbt.CompoundTaggetShareTag(net.minecraft.world.item.ItemStack stack) intgetVolumeUpgrades(net.minecraft.world.item.ItemStack stack) Get the number of volume upgrades currently in this ItemStack.net.minecraftforge.common.capabilities.ICapabilityProviderinitCapabilities(net.minecraft.world.item.ItemStack stack, net.minecraft.nbt.CompoundTag nbt) booleanisBarVisible(net.minecraft.world.item.ItemStack pStack) booleanisEnchantable(net.minecraft.world.item.ItemStack stack) static net.minecraft.nbt.CompoundTagroundedPressure(net.minecraft.world.item.ItemStack stack) Get an ItemStack's NBT, rounding its air level for sync to client.booleanshouldCauseReequipAnimation(net.minecraft.world.item.ItemStack oldStack, net.minecraft.world.item.ItemStack newStack, boolean slotChanged) Methods inherited from class net.minecraft.world.item.Item
allowdedIn, 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, verifyTagAfterLoadMethods inherited from class net.minecraftforge.registries.ForgeRegistryEntry
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraftforge.common.extensions.IForgeItem
canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getArmorTexture, getAttributeModifiers, getBurnTime, getContainerItem, getCreativeTabs, getCreatorModId, getDamage, getDefaultTooltipHideFlags, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getItemEnchantability, getItemStackLimit, getMaxDamage, getSweepHitBox, getXpRepairRatio, hasContainerItem, hasCustomEntity, isBookEnchantable, isCorrectToolForDrops, isDamageable, isDamaged, isEnderMask, isPiglinCurrency, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onItemUseFirst, onLeftClickEntity, onUsingTick, readShareTag, setDamage, shouldCauseBlockBreakResetMethods 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:
shouldCauseReequipAnimationin interfacenet.minecraftforge.common.extensions.IForgeItem
-
isBarVisible
public boolean isBarVisible(net.minecraft.world.item.ItemStack pStack) - Overrides:
isBarVisiblein classnet.minecraft.world.item.Item
-
getBarWidth
public int getBarWidth(net.minecraft.world.item.ItemStack pStack) - Overrides:
getBarWidthin classnet.minecraft.world.item.Item
-
getBarColor
public int getBarColor(net.minecraft.world.item.ItemStack pStack) - Overrides:
getBarColorin classnet.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:
fillItemCategoryin classnet.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:
initCapabilitiesin interfacenet.minecraftforge.common.extensions.IForgeItem
-
getBaseVolume
public int getBaseVolume()Description copied from interface:IPressurizableItemGet the base item volume before any volume upgrades are added.- Specified by:
getBaseVolumein interfaceIPressurizableItem- Returns:
- the base volume
-
getVolumeUpgrades
public int getVolumeUpgrades(net.minecraft.world.item.ItemStack stack) Description copied from interface:IPressurizableItemGet the number of volume upgrades currently in this ItemStack.- Specified by:
getVolumeUpgradesin interfaceIPressurizableItem- 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:IPressurizableItemGet the amount of air currently held in this ItemStack.- Specified by:
getAirin interfaceIPressurizableItem- Parameters:
stack- the ItemStack to check- Returns:
- the amount of air, in mL
-
isEnchantable
public boolean isEnchantable(net.minecraft.world.item.ItemStack stack) - Overrides:
isEnchantablein classnet.minecraft.world.item.Item
-
getEnchantmentValue
public int getEnchantmentValue()- Overrides:
getEnchantmentValuein classnet.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
-