Skip to content

pc: Fix slow break time for harvest-restricted blocks (1.20.5-1.21.11)#1193

Open
VasilisDragon wants to merge 1 commit into
PrismarineJS:masterfrom
VasilisDragon:fix/blocks-incorrect-for-wooden-tool-material
Open

pc: Fix slow break time for harvest-restricted blocks (1.20.5-1.21.11)#1193
VasilisDragon wants to merge 1 commit into
PrismarineJS:masterfrom
VasilisDragon:fix/blocks-incorrect-for-wooden-tool-material

Conversation

@VasilisDragon
Copy link
Copy Markdown

@VasilisDragon VasilisDragon commented May 25, 2026

Summary

Blocks with "material": "incorrect_for_wooden_tool" and populated harvestTools report a digTime roughly 9× too slow when broken with a tool that can actually harvest them.

For diamond_ore with a netherite pickaxe (item id 943): materials["incorrect_for_wooden_tool"] only contains the wooden tool ids (912–915), so the lookup misses, speed defaults to 1.0, and digTime returns ceil(1 / (1.0/3.0/30.0)) * 50 = 4550 ms. Vanilla expects ~500 ms. The block is breakable — canHarvest reads harvestTools, which is correct — it just takes 9× longer than vanilla.

Fix

Where material === "incorrect_for_wooden_tool" and harvestTools is non-empty, switch the material to "mineable/pickaxe". That table is already populated for every pickaxe tier (913, 918, 923, 928, 933, 938, 943 → 2, 1, 4, 12, 6, 8, 9). harvestTools is untouched, so canHarvest still enforces the tier gate.

crafter matches the material but has no harvestTools, so it's not touched here.

Verification

Repro with prismarine-block + minecraft-data, vs. values from the Breaking page on the Minecraft Wiki:

block tool before after vanilla
diamond_ore netherite_pickaxe 4550 ms 500 ms 500 ms
diamond_ore diamond_pickaxe 4550 ms 600 ms 600 ms
diamond_ore iron_pickaxe 4550 ms 750 ms 750 ms
iron_ore iron_pickaxe 4550 ms 750 ms 750 ms
iron_ore stone_pickaxe 4550 ms 1150 ms 1150 ms
obsidian netherite_pickaxe 75000 ms 8350 ms 8350 ms
obsidian diamond_pickaxe 75000 ms 9400 ms 9400 ms
ancient_debris netherite_pickaxe 45000 ms 5000 ms 5000 ms
netherite_block netherite_pickaxe 75000 ms 8350 ms 8350 ms
copper_block iron_pickaxe 4550 ms 750 ms 750 ms

Wrong-tool penalties (e.g. wooden pickaxe on diamond_ore) and bare-hand times are unchanged.

Scope

842 line changes across 9 version directories. Every changed line is exactly:

-    "material": "incorrect_for_wooden_tool",
+    "material": "mineable/pickaxe",
version blocks updated
1.20.5 60
1.21.1 100
1.21.3 100
1.21.4 92
1.21.5 92
1.21.6 92
1.21.8 92
1.21.9 107
1.21.11 107
total 842

Refs

Checklist

  • Schema validation passes for all 9 versions
  • audit_blocks parity check passes
  • Mocha test suite passes locally
  • Diff is line-for-line — same line count added/removed, no other fields touched

Across 1.20.5-1.21.11, blocks like diamond_ore, iron_ore, obsidian,
ancient_debris, netherite_block, and the copper family carry
material "incorrect_for_wooden_tool" but have a populated harvestTools
entry. The materials table for that key only contains the wooden tool
ids (912-915), so a higher-tier tool lookup (e.g. netherite_pickaxe = 943)
misses, speed defaults to 1.0, and digTime returns ~4550 ms where
vanilla expects ~500 ms.

Switching the material to "mineable/pickaxe" routes the lookup to the
populated tier table (913, 918, 923, 928, 933, 938, 943 -> 2, 1, 4, 12,
6, 8, 9). harvestTools is untouched, so canHarvest still enforces the
iron+/stone+ gate exactly as before.

Affects 842 entries across 9 version directories.

Refs: PrismarineJS#987, PrismarineJS#412, prismarine-block#22
@extremeheat
Copy link
Copy Markdown
Member

You would need to update the data generator for this, as all that data is automatically generated. It would be outdated every version.

The better fix is to properly implement the tag system

PrismarineJS/minecraft-data-generator#56 is adding that on the data gen side, data for that is in #1080

@VasilisDragon
Copy link
Copy Markdown
Author

You would need to update the data generator for this, as all that data is automatically generated. It would be outdated every version.

The better fix is to properly implement the tag system

PrismarineJS/minecraft-data-generator#56 is adding that on the data gen side, data for that is in #1080

Makes sense — thanks for the pointer.

I hit this while patching Cairn locally and opened this mainly to make the repro/failure mode visible, not to push a generated-data edit as the long-term fix. I agree the durable fix belongs in the generator/tag path.

I’ll leave this as repro context and won’t push this data-level approach further.

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.

2 participants