Skip to content

Smelting & furnaces (furnace block, fuel timer, smelt recipes) #10

Description

@MichaelFisher1997

Depends on #2 (ores) for things to smelt into ingots, and on #1 (crafting) UI/slot patterns. Build after both.

Context

There is currently no furnace block in src/game/gen/BlockIds.ts (ids 0-37, with 28/29 reserved for glowstone/flowing water), and no smelting/tick code anywhere in the codebase (grep for smelt/furnace returns only false positives).

Scope

  • src/game/gen/BlockIds.ts — append FURNACE (and FURNACE_LIT as a separate block id, or a block-state flag — see implementation note). Coordinated edit with Blocks.ts + Textures.ts per AGENTS.md.
  • src/engine/Textures.ts — furnace top/side/front textures; lit variant with glowing front.
  • New furnace UI (extend src/ui/InventoryUI.ts or add src/ui/FurnaceUI.ts) — three slots: input, fuel, output. Reuse the drag/drop code from the inventory refactor in Voxel lighting + day/night cycle (sun, moon, two-channel shading) #1.
  • New src/game/Smelting.ts (or extend Recipes.ts from Voxel lighting + day/night cycle (sun, moon, two-channel shading) #1) — SMELTING table:
    • iron ore → iron ingot, copper ore → copper ingot, gold ore → gold ingot
    • sand → glass, cobblestone → stone
    • raw food → cooked food (e.g. raw beef → cooked beef, already an item)
    • log → charcoal
  • Fuel burn timer — coal (longest), charcoal, wood/planks, sticks (shortest). Each fuel has a burn-ticks value; furnace advances one smelt per fuel-burn-duration. Lit furnace emits block-light glow (reuse the existing block-light channel from the lighting system) with a flicker.
  • Furnace tick system — a per-furnace state object (input/fuel/output + progress + burn time) ticked at the liquid-sim rate (20 Hz) or a dedicated slower cadence. State must persist with the chunk save format (per-seed localStorage saves).

Acceptance criteria

  • Player can craft/place a furnace block and open its UI by right-clicking.
  • Loading fuel + input smelts the input over time and emits block-light while burning.
  • Fuel is consumed in real time; output accumulates in the output slot.
  • Furnace state survives save/reload.
  • Smelt recipes are data-driven (easy to extend).

Roadmap reference

Phase 2 — "Smelting & furnaces".

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestphase-2Phase 2 — Crafting & survival depth (active)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions