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
    • registerUpgradeAcceptor

      public void registerUpgradeAcceptor(@Nonnull IUpgradeAcceptor upgradeAcceptor)
      Description copied from interface: IItemRegistry
      Register 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:
      registerUpgradeAcceptor in interface IItemRegistry
      Parameters:
      upgradeAcceptor - the upgrade acceptor
    • makeUpgradeItem

      public net.minecraft.world.item.Item makeUpgradeItem(Supplier<PNCUpgrade> upgrade, int tier)
      Description copied from interface: IItemRegistry
      Convenience method to create an Item implementing the IUpgradeItem interface, which can be used as a PneumaticCraft upgrade. This item has the default PneumaticCraft tooltip behaviour in that IItemRegistry.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£eItem yourself.

      Specified by:
      makeUpgradeItem in interface IItemRegistry
      Parameters:
      upgrade - a supplier for the upgrade object, which will not yet be registered
      tier - upgrade tier of this item
      Returns:
      an item
    • addTooltip

      public void addTooltip(PNCUpgrade upgrade, List<net.minecraft.network.chat.Component> tooltip)
      Description copied from interface: IItemRegistry
      Can be used for custom upgrade items to handle tooltips. This will work for implementors registered via IItemRegistry.registerUpgradeAcceptor(IUpgradeAcceptor). This is intended to be called from Item.appendHoverText(ItemStack, Level, List, TooltipFlag) method to display which machines and/or items accept it.
      Specified by:
      addTooltip in interface IItemRegistry
      Parameters:
      upgrade - the upgrade item
      tooltip - the tooltip string list to append to
    • 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
      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
      maxPressure - the maximum pressure allowed for the item
      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
    • getUpgradeRegistry

      public IUpgradeRegistry getUpgradeRegistry()
      Description copied from interface: IItemRegistry
      Get the upgrade registry handler, which can be used to register custom upgrades with block entities, entities and items.
      Specified by:
      getUpgradeRegistry in interface IItemRegistry
      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: 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