BarType
Represents all types of metal bars that can be smelted in the game.
EnumRLPlugins API
public enum BarTypeValues
BRONZE, ADAMANT, BLURITE, CUPRONICKEL, ELEMENTAL, GOLD, IRON, LEAD, LOVAKITE, LUNAR, MITHRIL, RUNE, SILVER, STEEL
Members
Methods
- booleancanSmelt()
Checks if all requirements are met to smelt this bar.
- BarTypefromBarId(int)
Finds a BarType by its bar item ID.
- BarTypefromName(String)
Finds a BarType by its display name (case-insensitive).
- intgetBarId()
Returns the item ID of the bar.
- doublegetBaseSmithingExp()
Returns the base smithing experience for this bar.
- intgetCoalCount()
Returns the quantity of coal required.
- intgetCoalCountBlastFurnace()
Returns the quantity of coal required at Blast Furnace (halved).
- StringgetDisplayName()
Returns the display name of the bar.
- List<SmeltingModifier>getModifiers()
Returns all smelting modifiers for this bar.
- intgetOreCount(int)
Returns the quantity of a specific ore required.
- List<OreRequirement>getOreRequirements()
Returns the list of ore requirements for smelting this bar.
- List<OreRequirement>getOreRequirements(boolean)
Returns the ore requirements adjusted for Blast Furnace (halves coal requirement).
- doublegetSmithingExp(boolean)
Returns the actual smithing experience based on current conditions.
- doublegetSuccessRate(boolean, boolean)
Returns the success rate for smelting this bar.
- intgetTotalOreCount(boolean)
Calculates the total number of ore items needed to smelt one bar.
- booleanhasOres(boolean)
Checks if player has the required ores for smelting.
- booleanrequiresCoal()
Checks if this bar requires coal.
canSmelt()
public boolean canSmelt()Checks if all requirements are met to smelt this bar.
This includes skills, quests, AND having the required ores in inventory.
Returns
True if all requirements are fulfilled.
fromBarId(int)static
public static BarType fromBarId(int barId)Finds a BarType by its bar item ID.
Parameters
barId- The bar's item ID.
Returns
The matching BarType, or null if not found.
fromName(String)static
public static BarType fromName(String name)Finds a BarType by its display name (case-insensitive).
Parameters
name- The display name to search for.
Returns
The matching BarType, or null if not found.
getBarId()
public int getBarId()Returns the item ID of the bar.
Returns
The bar's item ID.
getBaseSmithingExp()
public double getBaseSmithingExp()Returns the base smithing experience for this bar.
Use getSmithingExp(boolean) for context-aware experience calculation.
Returns
The base smithing experience.
getCoalCount()
public int getCoalCount()Returns the quantity of coal required.
Returns
The coal quantity, or 0 if coal is not required.
getCoalCountBlastFurnace()
public int getCoalCountBlastFurnace()Returns the quantity of coal required at Blast Furnace (halved).
Returns
The halved coal quantity, or 0 if coal is not required.
getDisplayName()
public String getDisplayName()Returns the display name of the bar.
Returns
The display name (e.g., "Bronze bar").
getModifiers()
public List<SmeltingModifier> getModifiers()Returns all smelting modifiers for this bar.
The returned list is unmodifiable.
Returns
Unmodifiable list of modifiers.
getOreCount(int)
public int getOreCount(int oreId)Returns the quantity of a specific ore required.
Parameters
oreId- The ore item ID to check.
Returns
The quantity required, or 0 if not required.
getOreRequirements()
public List<OreRequirement> getOreRequirements()Returns the list of ore requirements for smelting this bar.
Extracted from the consolidated requirements.
getOreRequirements(boolean)
public List<OreRequirement> getOreRequirements(boolean isBlastFurnace)Returns the ore requirements adjusted for Blast Furnace (halves coal requirement).
Parameters
isBlastFurnace- Is blast furnace.
getSmithingExp(boolean)
public double getSmithingExp(boolean hasGoldsmithGauntlets)Returns the actual smithing experience based on current conditions.
Parameters
hasGoldsmithGauntlets- Whether the player is wearing goldsmith gauntlets or smithing cape.
Returns
The modified smithing experience.
getSuccessRate(boolean, boolean)
public double getSuccessRate(boolean hasRingOfForging, boolean isBlastFurnace)Returns the success rate for smelting this bar.
Parameters
hasRingOfForging- Whether the player has a Ring of Forging equipped.
isBlastFurnace- Whether smelting at the Blast Furnace.
Returns
The success rate (0.0 to 1.0).
getTotalOreCount(boolean)
public int getTotalOreCount(boolean isBlastFurnace)Calculates the total number of ore items needed to smelt one bar.
Parameters
isBlastFurnace- Whether smelting at the Blast Furnace.
Returns
The total ore count.
hasOres(boolean)
public boolean hasOres(boolean isBlastFurnace)Checks if player has the required ores for smelting.
Separate from canSmelt() to allow for special cases like Blast Furnace.
Parameters
isBlastFurnace- Whether smelting at the Blast Furnace.
Returns
True if player has all required ores.
requiresCoal()
public boolean requiresCoal()Checks if this bar requires coal.
Returns
True if coal is required.
Also allowed
Every enum has these, as in plain Java.
compareTo, equals, hashCode, name, ordinal, toString, valueOf, values