Fix composite material regression from #71 and apply the fix to 26.1 - #86
Pix3lPirat3 wants to merge 2 commits into
Conversation
…fix to 26.1 Skip incorrect_for_* tags when picking a block's material instead of preferring the first mineable/* material. PrismarineJS#71's filter also outranked the composite materials (plant, leaves, gourd, vine, sword_instantly_mines), which are the only ones carrying sword and shears speeds. Composites are registered first, so first-match order is kept and only the drop-gating tags are skipped. 26.1 was added without PrismarineJS#71 and gets the same rule.
|
Regenerating against the merge base still loses some tool speeds:
Vanilla's |
|
Thanks, both are real: those blocks match two materials with different speed tables and first-match keeps only one, whichever way the filter goes. Pushed a second commit that registers the two missing composites next to the existing |
Blocks in sword_efficient and mineable/hoe (moss carpet, pink petals, pale moss carpet on 1.20.5 to 1.21.4) and, from 1.21.5, bamboo in sword_instantly_mines and mineable/axe, match two materials that carry different tool speeds, and the first match dropped one of them: the plant material kept the sword speed but lost the hoe (diamond hoe 8 -> 1, digTime 0 -> 150 ms), the sword_instantly_mines material lost the axe (diamond axe 8 -> 1, 200 -> 1500 ms). Vanilla ItemStack.getDestroySpeed returns 8 for both. Register the two composites like the existing plant;mineable/axe, so the block gets both speed tables. sword_instantly_mines only exists from 1.21.5, so that composite goes into the 1.21.5+ folders. Regenerated all eleven folders: the only material changes against the previous output are moss_carpet, pink_petals and pale_moss_carpet -> plant;mineable/hoe (1.20.5, 1.21, 1.21.3) and bamboo -> sword_instantly_mines;mineable/axe (1.21.5 to 26.1); materials.json gains the two entries.
0a472c2 to
13b448e
Compare
|
Both cases are fixed on the branch tip (13b448e added the plant;mineable/hoe and sword_instantly_mines;mineable/axe composites), so the regen that still lost speeds was against the merge base, before those composites existed. Verified by regenerating the branch tip and checking the generated data:
Those match vanilla's ItemStack.getDestroySpeed of 8 for both pairs, and the committed data on the PR already carries them. Could you re-run against the branch tip rather than the merge base to confirm on your side? |
rom1504
left a comment
There was a problem hiding this comment.
Astra agent review — AI-generated, not manually written by the maintainer.
The revised composites address the reported moss-carpet/hoe and bamboo/axe cases. I checked this exact head's CI-generated artifacts for 1.20.5, 1.21.3 and 26.1: every block material matches the candidate data in minecraft-data#1307. Production prismarine-block probes with that candidate data preserve the expected hoe/axe speeds and correct ore mining. The remaining 26.1 material-table differences are the copper/shears fixes already landed in data#1310 and supplied by generator#87/#88.
The code looks suitable to land once the incomplete CI checks are cleared. The failed 1.9.4 job is a Maven download read timeout, not a failure in these changed modules; 1.21.5/1.21.6 generation was cancelled. I used existing CI artifacts rather than rerunning a local Java server.
Skills used: prismarine-protocol-data-review followed generator output into the real block consumer and distinguished already-landed data from pending producer fixes; prismarine-architecture-review checked composite ordering and retention of both tool capabilities; prismarine-review verified the repaired feedback at the current head and diagnosed CI.
Since 1.20.5 the tool component registers incorrect_for_wooden_tool as a material ahead of mineable/pickaxe, so every tier-gated block (108 on 26.1) reported it as its material. Its speed table only lists wooden tools, so prismarine-block digTime() falls back to hand speed: iron ore with a diamond pickaxe reports 4550ms instead of 600ms (PrismarineJS/minecraft-data#987, PrismarineJS/mineflayer#3921, PrismarineJS/mineflayer#4131). #71 fixed that by preferring the first mineable/* material. Regenerating with it shows a side effect: the filter also outranks every composite material (plant;mineable/axe, leaves;mineable/hoe, gourd;mineable/axe, vine_or_glow_lichen;plant;mineable/axe, sword_instantly_mines), which are the only materials carrying sword and shears speeds. That moves 23–66 blocks per version away from vanilla - on 1.21.11, bamboo with a sword goes from 200ms to 1500ms and vine with shears from 150ms to 300ms. It went unnoticed because no data has been regenerated since #71 merged. mc/26.1 was added by #70 from a pre-#71 copy and still returns the first match unconditionally.
Fix: skip incorrect_for_* instead of preferring mineable/*. Composites are registered first, so first-match order is preserved and only the drop-gating tags are excluded. Applied to the ten folders #71 touched and to 26.1.
Verification (regenerated all eleven folders, compared blocks.json field by field):
#77 (26.2) carries the same pre-#71 code and needs the same lines. A minecraft-data update for 1.20.5–26.1 will follow from this output.