public enum ItemRegistry extends java.lang.Enum<ItemRegistry> implements IItemRegistry
| Enum Constant and Description |
|---|
INSTANCE |
| Modifier and Type | Field and Description |
|---|---|
java.util.List<IInventoryItem> |
inventoryItems |
| Modifier and Type | Method and Description |
|---|---|
void |
addTooltip(EnumUpgrade upgrade,
java.util.List<net.minecraft.util.text.ITextComponent> tooltip)
Can be used for custom upgrade items to handle tooltips.
|
boolean |
doesItemMatchFilter(net.minecraft.item.ItemStack filterStack,
net.minecraft.item.ItemStack stack,
boolean checkDurability,
boolean checkNBT,
boolean checkModSimilarity)
Convenience method to check if an item matches a given filter item.
|
static ItemRegistry |
getInstance() |
int |
getModifiedVolume(net.minecraft.item.ItemStack stack,
int originalVolume)
Get the modified volume for a given item, based on the volume modifiers registered with
IItemRegistry.registerPneumaticVolumeModifier(ItemVolumeModifier). |
ISpawnerCoreStats |
getSpawnerCoreStats(net.minecraft.item.ItemStack stack)
Get some information for the given Spawner Core item.
|
java.util.List<net.minecraft.item.ItemStack> |
getStacksInItem(net.minecraft.item.ItemStack item)
Get a list of the items contained in the given item.
|
IAirHandlerItem.Provider |
makeItemAirHandlerProvider(net.minecraft.item.ItemStack stack,
float maxPressure)
Create an instance of PneumaticCraft's default item air handler provider, suitable for returning
from
IForgeItem.initCapabilities(ItemStack, CompoundNBT). |
void |
registerInventoryItem(IInventoryItem handler)
Register a third-party class that can contain items.
|
void |
registerMagnetSuppressor(IMagnetSuppressor suppressor)
Register a magnet suppressor; an object which can prevent the Magnet Upgrade from pulling in (usually item)
entities.
|
void |
registerPneumaticVolumeModifier(ItemVolumeModifier modifierFunc)
Register a handler to modify the effective volume of a pneumatic item (i.e.
|
void |
registerUpgradeAcceptor(IUpgradeAcceptor upgradeAcceptor)
Register an item or block as being able to accept PneumaticCraft upgrades.
|
boolean |
shouldSuppressMagnet(net.minecraft.entity.Entity e) |
static ItemRegistry |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ItemRegistry[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ItemRegistry INSTANCE
public final java.util.List<IInventoryItem> inventoryItems
public static ItemRegistry[] values()
for (ItemRegistry c : ItemRegistry.values()) System.out.println(c);
public static ItemRegistry valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic static ItemRegistry getInstance()
public void registerInventoryItem(@Nonnull
IInventoryItem handler)
IItemRegistryIInventoryItem directly.registerInventoryItem in interface IItemRegistryhandler - instance of any class that implements IInventoryItempublic void registerUpgradeAcceptor(@Nonnull
IUpgradeAcceptor upgradeAcceptor)
IItemRegistryregisterUpgradeAcceptor in interface IItemRegistryupgradeAcceptor - the upgrade acceptorpublic void addTooltip(EnumUpgrade upgrade, java.util.List<net.minecraft.util.text.ITextComponent> tooltip)
IItemRegistryIItemRegistry.registerUpgradeAcceptor(IUpgradeAcceptor). This is intended to be called from
Item.appendHoverText(ItemStack, World, List, ITooltipFlag) method to display
which machines and/or items accept it.addTooltip in interface IItemRegistryupgrade - the upgrade itemtooltip - the tooltip string list to append topublic void registerMagnetSuppressor(IMagnetSuppressor suppressor)
IItemRegistryregisterMagnetSuppressor in interface IItemRegistrysuppressor - a suppressor objectpublic boolean doesItemMatchFilter(@Nonnull
net.minecraft.item.ItemStack filterStack,
@Nonnull
net.minecraft.item.ItemStack stack,
boolean checkDurability,
boolean checkNBT,
boolean checkModSimilarity)
IItemRegistryITagFilteringItem, so parameter order is important;
provide the filtering item first, and the item to check second.doesItemMatchFilter in interface IItemRegistryfilterStack - 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 IDspublic void registerPneumaticVolumeModifier(ItemVolumeModifier modifierFunc)
IItemRegistryregisterPneumaticVolumeModifier in interface IItemRegistrymodifierFunc - a volume modifier functionpublic ISpawnerCoreStats getSpawnerCoreStats(net.minecraft.item.ItemStack stack)
IItemRegistrygetSpawnerCoreStats in interface IItemRegistrystack - an ItemStack, which must be a Spawner Corepublic IAirHandlerItem.Provider makeItemAirHandlerProvider(net.minecraft.item.ItemStack stack, float maxPressure)
IItemRegistryIForgeItem.initCapabilities(ItemStack, CompoundNBT).
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.
makeItemAirHandlerProvider in interface IItemRegistrystack - the ItemStackmaxPressure - the maximum pressure allowed for the itempublic boolean shouldSuppressMagnet(net.minecraft.entity.Entity e)
public int getModifiedVolume(net.minecraft.item.ItemStack stack,
int originalVolume)
IItemRegistryIItemRegistry.registerPneumaticVolumeModifier(ItemVolumeModifier).getModifiedVolume in interface IItemRegistrystack - the ItemStack to checkoriginalVolume - the original volume, which is the item's base volume,
possibly already modified by Volume Upgradespublic java.util.List<net.minecraft.item.ItemStack> getStacksInItem(@Nonnull
net.minecraft.item.ItemStack item)
IInventoryItem interface.item - the item to check