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 TypeMethodDescriptionvoidaddVolumeModifierInfo(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.makeItemAirHandlerProvider(net.minecraft.world.item.ItemStack stack) 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).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.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
-
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 ItemStack, whose item must implementIPressurizableItemmaxPressure- the maximum pressure allowed for the item- Returns:
- an implementation of IAirHandler
-
makeItemAirHandlerProvider
public IAirHandlerItem.Provider makeItemAirHandlerProvider(net.minecraft.world.item.ItemStack stack) - Specified by:
makeItemAirHandlerProviderin interfaceIItemRegistry
-
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
-
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
-