Enum Class ItemRegistry
- All Implemented Interfaces:
Serializable,Comparable<ItemRegistry>,Constable,IItemRegistry
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTooltip(PNCUpgrade upgrade, List<net.minecraft.network.chat.Component> tooltip) Can be used for custom upgrade items to handle tooltips.voidaddVolumeModifierInfo(net.minecraft.world.item.ItemStack stack, List<net.minecraft.network.chat.Component> text) booleandoesItemMatchFilter(net.minecraft.world.item.ItemStack filterStack, net.minecraft.world.item.ItemStack stack, boolean checkDurability, boolean checkNBT, boolean checkModSimilarity) Convenience method to check if an item matches a given filter item.static ItemRegistryintgetModifiedVolume(net.minecraft.world.item.ItemStack stack, int originalVolume) Get the modified volume for a given item, based on the volume modifiers registered withIItemRegistry.registerPneumaticVolumeModifier(ItemVolumeModifier).getSpawnerCoreStats(net.minecraft.world.item.ItemStack stack) Get some information for the given Spawner Core item.List<net.minecraft.world.item.ItemStack>getStacksInItem(net.minecraft.world.item.ItemStack item) Get a list of the items contained in the given item.Get the upgrade registry handler, which can be used to register custom upgrades with block entities, entities and items.makeItemAirHandlerProvider(net.minecraft.world.item.ItemStack stack, float maxPressure) Create an instance of PneumaticCraft's default item air handler provider, suitable for returning fromIForgeItem.initCapabilities(ItemStack, CompoundTag).net.minecraft.world.item.ItemmakeUpgradeItem(Supplier<PNCUpgrade> upgrade, int tier) Convenience method to create an Item implementing theIUpgradeIteminterface, which can be used as a PneumaticCraft upgrade.voidregisterInventoryItem(IInventoryItem handler) Register a third-party class that can contain items.voidregisterItemLaunchBehaviour(ILaunchBehaviour behaviour) Register an item launch behaviour for use by the Air Cannon and Pneumatic Chestplate Item Launcher (Dispenser upgrade).voidregisterMagnetSuppressor(IMagnetSuppressor suppressor) Register a magnet suppressor; an object which can prevent the Magnet Upgrade from pulling in (usually item) entities.voidregisterPneumaticVolumeModifier(ItemVolumeModifier modifierFunc) Register a handler to modify the effective volume of a pneumatic item (i.e.voidregisterUpgradeAcceptor(IUpgradeAcceptor upgradeAcceptor) Register an item or block as being able to accept PneumaticCraft upgrades.booleanshouldSuppressMagnet(net.minecraft.world.entity.Entity e) static ItemRegistryReturns the enum constant of this class with the specified name.static ItemRegistry[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Field Details
-
inventoryItems
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getInstance
-
registerInventoryItem
Description copied from interface:IItemRegistryRegister a third-party class that can contain items. This is intended for classes from other mods - if it's your class, just make it implementIInventoryItemdirectly.- Specified by:
registerInventoryItemin interfaceIItemRegistry- Parameters:
handler- instance of any class that implementsIInventoryItem
-
registerUpgradeAcceptor
Description copied from interface:IItemRegistryRegister an item or block as being able to accept PneumaticCraft upgrades. This is safe to call in your own mod's init thread.- Specified by:
registerUpgradeAcceptorin interfaceIItemRegistry- Parameters:
upgradeAcceptor- the upgrade acceptor
-
makeUpgradeItem
Description copied from interface:IItemRegistryConvenience method to create an Item implementing theIUpgradeIteminterface, which can be used as a PneumaticCraft upgrade. This item has the default PneumaticCraft tooltip behaviour in thatIItemRegistry.addTooltip(PNCUpgrade, List)is called when Shift is held while hovering over the item.You can use this method when registering upgrade items as an alternative to creating an Item which implements
IUpgrad£eItemyourself.- Specified by:
makeUpgradeItemin interfaceIItemRegistry- Parameters:
upgrade- a supplier for the upgrade object, which will not yet be registeredtier- upgrade tier of this item- Returns:
- an item
-
addTooltip
Description copied from interface:IItemRegistryCan be used for custom upgrade items to handle tooltips. This will work for implementors registered viaIItemRegistry.registerUpgradeAcceptor(IUpgradeAcceptor). This is intended to be called fromItem.appendHoverText(ItemStack, Level, List, TooltipFlag)method to display which machines and/or items accept it.- Specified by:
addTooltipin interfaceIItemRegistry- Parameters:
upgrade- the upgrade itemtooltip- the tooltip string list to append to
-
registerMagnetSuppressor
Description copied from interface:IItemRegistryRegister a magnet suppressor; an object which can prevent the Magnet Upgrade from pulling in (usually item) entities.- Specified by:
registerMagnetSuppressorin interfaceIItemRegistry- Parameters:
suppressor- a suppressor object
-
doesItemMatchFilter
public boolean doesItemMatchFilter(@Nonnull net.minecraft.world.item.ItemStack filterStack, @Nonnull net.minecraft.world.item.ItemStack stack, boolean checkDurability, boolean checkNBT, boolean checkModSimilarity) Description copied from interface:IItemRegistryConvenience method to check if an item matches a given filter item. Note that the filtering item (the first parameter) could be a Tag Filter, Classify Filter, or other instance ofIFilteringItem, so parameter order is important; provide the filtering item first, and the item to check second.- Specified by:
doesItemMatchFilterin interfaceIItemRegistry- Parameters:
filterStack- the item to check againststack- the item being checkedcheckDurability- true if item durability should be taken into accountcheckNBT- true if item NBT should be taken into accountcheckModSimilarity- true to just match by the two items' mod IDs- Returns:
- true if the item passes the filter test, false otherwise
-
registerPneumaticVolumeModifier
Description copied from interface:IItemRegistryRegister a handler to modify the effective volume of a pneumatic item (i.e. one that holds air/pressure).- Specified by:
registerPneumaticVolumeModifierin interfaceIItemRegistry- Parameters:
modifierFunc- a volume modifier function
-
getSpawnerCoreStats
Description copied from interface:IItemRegistryGet some information for the given Spawner Core item.- Specified by:
getSpawnerCoreStatsin interfaceIItemRegistry- Parameters:
stack- an ItemStack, which must be a Spawner Core- Returns:
- a spawner core stats object, to query and manipulate the item
-
makeItemAirHandlerProvider
public IAirHandlerItem.Provider makeItemAirHandlerProvider(net.minecraft.world.item.ItemStack stack, float maxPressure) Description copied from interface:IItemRegistryCreate an instance of PneumaticCraft's default item air handler provider, suitable for returning fromIForgeItem.initCapabilities(ItemStack, CompoundTag).You can use this method for your own air-handling items, provided that your item implements
IPressurizableItem. If you want to avoid a hard dependency on PneumaticCraft, then create your own custom implementation ofIAirHandlerItem, and attach that implementation to your item viaAttachCapabilitiesEvent.- Specified by:
makeItemAirHandlerProviderin interfaceIItemRegistry- Parameters:
stack- the ItemStackmaxPressure- the maximum pressure allowed for the item- Returns:
- an implementation of IAirHandler
-
registerItemLaunchBehaviour
Description copied from interface:IItemRegistryRegister an item launch behaviour for use by the Air Cannon and Pneumatic Chestplate Item Launcher (Dispenser upgrade). Call this from aFMLCommonSetupEventlistener; noenqueueWork()required.- Specified by:
registerItemLaunchBehaviourin interfaceIItemRegistry- Parameters:
behaviour- the launch behaviour to register
-
getUpgradeRegistry
Description copied from interface:IItemRegistryGet the upgrade registry handler, which can be used to register custom upgrades with block entities, entities and items.- Specified by:
getUpgradeRegistryin interfaceIItemRegistry- Returns:
- the upgrade registry
-
shouldSuppressMagnet
public boolean shouldSuppressMagnet(net.minecraft.world.entity.Entity e) -
getModifiedVolume
public int getModifiedVolume(net.minecraft.world.item.ItemStack stack, int originalVolume) Description copied from interface:IItemRegistryGet the modified volume for a given item, based on the volume modifiers registered withIItemRegistry.registerPneumaticVolumeModifier(ItemVolumeModifier).- Specified by:
getModifiedVolumein interfaceIItemRegistry- Parameters:
stack- the ItemStack to checkoriginalVolume- the original volume, which is the item's base volume, possibly already modified by Volume Upgrades- Returns:
- the modified volume
-
addVolumeModifierInfo
public void addVolumeModifierInfo(net.minecraft.world.item.ItemStack stack, List<net.minecraft.network.chat.Component> text) -
getStacksInItem
public List<net.minecraft.world.item.ItemStack> getStacksInItem(@Nonnull net.minecraft.world.item.ItemStack item) Get a list of the items contained in the given item. This uses theIInventoryIteminterface.- Parameters:
item- the item to check- Returns:
- a list of the items contained within the given item
-