Enum Class ItemRegistry

java.lang.Object
java.lang.Enum<ItemRegistry>
me.desht.pneumaticcraft.common.item.ItemRegistry
All Implemented Interfaces:
Serializable, Comparable<ItemRegistry>, Constable, IItemRegistry

public enum ItemRegistry extends Enum<ItemRegistry> implements IItemRegistry
  • Enum Constant Details

  • Field Details

  • Method Details

    • values

      public static ItemRegistry[] 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

      public static ItemRegistry valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getInstance

      public static ItemRegistry getInstance()
    • registerInventoryItem

      public void registerInventoryItem(@Nonnull IInventoryItem handler)
      Description copied from interface: IItemRegistry
      Register a third-party class that can contain items. This is intended for classes from other mods - if it's your class, just make it implement IInventoryItem directly.
      Specified by:
      registerInventoryItem in interface IItemRegistry
      Parameters:
      handler - instance of any class that implements IInventoryItem
    • registerMagnetSuppressor

      public void registerMagnetSuppressor(IMagnetSuppressor suppressor)
      Description copied from interface: IItemRegistry
      Register a magnet suppressor; an object which can prevent the Magnet Upgrade from pulling in (usually item) entities.
      Specified by:
      registerMagnetSuppressor in interface IItemRegistry
      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: IItemRegistry
      Convenience 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 of IFilteringItem, so parameter order is important; provide the filtering item first, and the item to check second.
      Specified by:
      doesItemMatchFilter in interface IItemRegistry
      Parameters:
      filterStack - the item to check against
      stack - the item being checked
      checkDurability - true if item durability should be taken into account
      checkNBT - true if item NBT should be taken into account
      checkModSimilarity - true to just match by the two items' mod IDs
      Returns:
      true if the item passes the filter test, false otherwise
    • registerPneumaticVolumeModifier

      public void registerPneumaticVolumeModifier(ItemVolumeModifier modifierFunc)
      Description copied from interface: IItemRegistry
      Register a handler to modify the effective volume of a pneumatic item (i.e. one that holds air/pressure).
      Specified by:
      registerPneumaticVolumeModifier in interface IItemRegistry
      Parameters:
      modifierFunc - a volume modifier function
    • getSpawnerCoreStats

      public ISpawnerCoreStats getSpawnerCoreStats(net.minecraft.world.item.ItemStack stack)
      Description copied from interface: IItemRegistry
      Get some information for the given Spawner Core item.
      Specified by:
      getSpawnerCoreStats in interface IItemRegistry
      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: IItemRegistry
      Specified by:
      makeItemAirHandlerProvider in interface IItemRegistry
      Parameters:
      stack - the ItemStack, whose item must implement IPressurizableItem
      maxPressure - the maximum pressure allowed for the item
      Returns:
      an implementation of IAirHandler
    • makeItemAirHandlerProvider

      public IAirHandlerItem.Provider makeItemAirHandlerProvider(net.minecraft.world.item.ItemStack stack)
      Description copied from interface: IItemRegistry
      Create an instance of PneumaticCraft's default item air handler provider, suitable for returning from IForgeItem.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 of IAirHandlerItem, and attach that implementation to your item via AttachCapabilitiesEvent.

      Specified by:
      makeItemAirHandlerProvider in interface IItemRegistry
      Parameters:
      stack - the ItemStack, whose item must implement IPressurizableItem
      Returns:
      an implementation of IAirHandler
    • registerItemLaunchBehaviour

      public void registerItemLaunchBehaviour(ILaunchBehaviour behaviour)
      Description copied from interface: IItemRegistry
      Register an item launch behaviour for use by the Air Cannon and Pneumatic Chestplate Item Launcher (Dispenser upgrade). Call this from a FMLCommonSetupEvent listener; no enqueueWork() required.
      Specified by:
      registerItemLaunchBehaviour in interface IItemRegistry
      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: IItemRegistry
      Get the modified volume for a given item, based on the volume modifiers registered with IItemRegistry.registerPneumaticVolumeModifier(ItemVolumeModifier).
      Specified by:
      getModifiedVolume in interface IItemRegistry
      Parameters:
      stack - the ItemStack to check
      originalVolume - 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 the IInventoryItem interface.
      Parameters:
      item - the item to check
      Returns:
      a list of the items contained within the given item