Skip to content

block: guard zero-value smelter experience - #1303

Open
HashimTheArab wants to merge 1 commit into
df-mc:masterfrom
HashimTheArab:agent/smelter-experience-zero-value
Open

block: guard zero-value smelter experience#1303
HashimTheArab wants to merge 1 commit into
df-mc:masterfrom
HashimTheArab:agent/smelter-experience-zero-value

Conversation

@HashimTheArab

Copy link
Copy Markdown
Collaborator

Summary

Guard smelter.Experience against nil receivers so zero-value furnace, blast furnace, and smoker block values report no stored XP instead of panicking when their BreakInfo is computed.

Zero-value smelter blocks can appear as stateless block registry or palette values. Initializing those prototypes with newSmelter would give shared mutable inventory state to the registered block value, so treating missing smelter state as zero stored XP keeps the stateful data on decoded block entities.

Validation

  • Reproduced the upstream panic locally with a temporary test against block.Furnace{}, block.BlastFurnace{}, and block.Smoker{} calling BreakInfo().XPDrops.
  • Verified the same temporary test passes after the fix, then removed it from the branch as requested.
  • go test ./server/... -count=1

@HashimTheArab
HashimTheArab marked this pull request as ready for review July 8, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant