Class PNCUpgradeImpl
java.lang.Object
me.desht.pneumaticcraft.common.upgrades.PNCUpgradeImpl
- All Implemented Interfaces:
PNCUpgrade
-
Method Summary
Modifier and TypeMethodDescriptionintA numeric id for the upgrade which is not guaranteed to be persistent across game restarts.net.minecraft.resources.ResourceLocationgetId()Get the upgrade's unique IDfinal net.minecraft.world.item.ItemgetItem(int tier) Get the corresponding item for this upgrade and tier.final net.minecraft.resources.ResourceLocationgetItemRegistryName(int tier) Get the corresponding item registry name for this upgrade and tier.final net.minecraft.world.item.ItemStackgetItemStack(int count) Get an itemstack for the given upgradefinal intGet the max upgrade tier allowable for this upgrade.final booleanCheck if this upgrade's dependent mods are loaded.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.desht.pneumaticcraft.api.upgrade.PNCUpgrade
getItem, getItemRegistryName, getItemStack
-
Method Details
-
getId
public net.minecraft.resources.ResourceLocation getId()Description copied from interface:PNCUpgradeGet the upgrade's unique ID- Specified by:
getIdin interfacePNCUpgrade- Returns:
- the upgrade ID
-
getCacheId
public int getCacheId()Description copied from interface:PNCUpgradeA numeric id for the upgrade which is not guaranteed to be persistent across game restarts. Used internally for performance; do not depend on the value of this.- Specified by:
getCacheIdin interfacePNCUpgrade- Returns:
- a numeric ID, for internal use
-
getMaxTier
public final int getMaxTier()Description copied from interface:PNCUpgradeGet the max upgrade tier allowable for this upgrade.- Specified by:
getMaxTierin interfacePNCUpgrade- Returns:
- the max tier
-
isDependencyLoaded
public final boolean isDependencyLoaded()Description copied from interface:PNCUpgradeCheck if this upgrade's dependent mods are loaded. Used to control whether the upgrade is added to the creative item list (and thus JEI), and whether any upgrade info is shown for it in GUI side tabs. Note that upgrades are always registered in Forge registries, even if dependent mods are missing.- Specified by:
isDependencyLoadedin interfacePNCUpgrade- Returns:
- true if this upgrade's dependencies are satisfied, false otherwise
-
getItemRegistryName
public final net.minecraft.resources.ResourceLocation getItemRegistryName(int tier) Description copied from interface:PNCUpgradeGet the corresponding item registry name for this upgrade and tier. The item ID is determined by appending "_upgrade" to the upgrade's ID, followed by "_{tier-number}" if this upgrade has more than one tier.- Specified by:
getItemRegistryNamein interfacePNCUpgrade- Parameters:
tier- the upgrade tier- Returns:
- an item registry name
-
getItem
public final net.minecraft.world.item.Item getItem(int tier) Description copied from interface:PNCUpgradeGet the corresponding item for this upgrade and tier. The item ID is determined by appending "_upgrade" to th upgrade's ID, followed by "_{tier-number}" if this upgrade has more than one tier.- Specified by:
getItemin interfacePNCUpgrade- Parameters:
tier- the upgrade tier- Returns:
- a Minecraft item, or air if no corresponding item can be found
-
getItemStack
public final net.minecraft.world.item.ItemStack getItemStack(int count) Description copied from interface:PNCUpgradeGet an itemstack for the given upgrade- Specified by:
getItemStackin interfacePNCUpgrade- Parameters:
count- number of items in the stack- Returns:
- an upgrade itemstack
-