Skip to main content

ProcessingDataProvider

Runtime data provider for processing skills (cooking, firemaking, smelting, smithing). Builds lookup tables from recipe manifest files loaded by DataManager. Location: packages/shared/src/data/ProcessingDataProvider.ts

Overview

ProcessingDataProvider is a singleton that:
  1. Loads recipe manifests from recipes/ directory
  2. Builds efficient lookup tables for runtime queries
  3. Provides methods to check requirements and availability
  4. Falls back to embedded item data if manifests missing

Initialization


Cooking Methods

isCookableItem

Check if an item can be cooked.
Example:

getCookingData

Get cooking data for a raw food item.
Returns:
Example:

getCookableItemIds

Get all cookable item IDs.

getCookingLevel

Get cooking level requirement for an item.

getCookingXP

Get cooking XP for an item.

Firemaking Methods

isBurneableLog

Check if an item can be burned.

getFiremakingData

Get firemaking data for a log.
Returns:

getBurneableLogIds

Get all burneable log IDs.

getFiremakingLevel

Get firemaking level requirement for a log.

getFiremakingXP

Get firemaking XP for a log.

Smelting Methods

isSmeltableBar

Check if an item is a smeltable bar.
Example:

getSmeltingData

Get smelting data for a bar.
Returns:
Example:

getSmeltableBarsFromInventory

Get all bars that can be smelted from inventory.
Example:

isSmeltableOre

Check if an item is an ore that can be used for smelting.

getSmeltableOreIds

Get all ore IDs that can be used for smelting.

getSmeltableBarIds

Get all smeltable bar IDs.

getSmeltingLevel

Get smelting level requirement for a bar.

getSmeltingXP

Get smelting XP for a bar.

getSmeltingTicks

Get smelting ticks for a bar (time in game ticks).

Smithing Methods

isSmithableItem

Check if an item can be smithed.
Example:

getSmithingRecipe

Get smithing recipe data for an output item.
Returns:
Example:

getSmithableItemsFromInventory

Get all items that can be smithed from inventory (deprecated - use getSmithableItemsWithAvailability instead).

getSmithableItemsWithAvailability

Get all smithable items with availability info for UI display.
Returns:
Example:
This method returns ALL recipes for bar types the player has, including items they can’t make yet. Use the meetsLevel and hasBars flags to grey out unavailable items in the UI.

getSmithingRecipesForBar

Get all recipes for a specific bar type.
Example:

getSmithingRecipesByCategory

Get recipes grouped by category for a specific bar type.
Example:

getAllSmithingRecipes

Get all smithing recipes.

getAvailableSmithingRecipes

Get all recipes the player can make with their smithing level.

getSmithableItemIds

Get all smithable item IDs.

getSmithingLevel

Get smithing level requirement for an item.

getSmithingXP

Get smithing XP for an item.

getSmithingTicks

Get smithing ticks for an item (time in game ticks).

Utility Methods

getSummary

Get summary of loaded data.
Example:

rebuild

Rebuild all lookup tables (for testing or after manifest reload).

Performance Optimizations

Pre-Allocated Buffers

ProcessingDataProvider uses pre-allocated buffers to reduce GC pressure:
This avoids creating new Map instances on every inventory query.

Manifest Loading

ProcessingDataProvider loads recipes from JSON manifests:

Loading Order

  1. DataManager loads recipe manifests from recipes/ directory
  2. DataManager calls processingDataProvider.loadCookingRecipes(manifest)
  3. DataManager calls processingDataProvider.loadSmeltingRecipes(manifest)
  4. DataManager calls processingDataProvider.loadSmithingRecipes(manifest)
  5. DataManager calls processingDataProvider.rebuild()

Fallback Behavior

If recipe manifests are missing, ProcessingDataProvider falls back to embedded item data:
This ensures backwards compatibility with older manifest formats.

Type Definitions

CookingItemData

FiremakingItemData

SmeltingItemData

SmithingRecipeData

SmithingRecipeWithAvailability


Manifest Structures

CookingManifest

FiremakingManifest

SmeltingManifest

SmithingManifest


Usage Examples

Check if Player Can Smelt

Get Smithing UI Data

Validate Smelting Request