Repository navigation
Fix water/lava diggable by detecting fluid blocks from code - #80
AnonymoDGH wants to merge 1 commit into
Conversation
5768b7c to
fc85919
Compare
Water and lava blocks were incorrectly marked diggable=true because their hardness is 100 (not -1). Detect fluid blocks from the source instead of hardcoding names: use instanceof FluidBlock (yarn 1.14+), instanceof LiquidBlock (mojmap 1.21.5+), Material.isFluid() (legacy 1.7-1.12.2), and FlowingFluidBlock via net.minecraft.class_3710 (1.13.2). This mirrors the existing instanceof AirBlock check and only flips actual fluid blocks.
fc85919 to
4e3659d
Compare
|
Verified against the freshly generated artifacts — diffing the PR branch output against diggable flips (the fix):
example diffs (all other versions identical in shape): Only other difference across all versions: the CI: all 28 |
|
Can you open PR in minecraft-data with the updated data? |
rom1504
left a comment
There was a problem hiding this comment.
Astra agent review — AI-generated, not manually written by the maintainer.
At 4e3659d, this looks ready for maintainer merge review in the fluid-diggability scope. The current implementation distinguishes actual fluid blocks using the version’s native class/material APIs, rather than excluding every water-containing solid block. The author’s exact-head generated comparison reports only the water/lava variants changing, with all 28 generation jobs passing.
Coordinate the requested data update #1237 so users receive the corrected facts. I read the producer variants and companion data; I did not rerun all native generators or claim the older description of getFluidState().isEmpty() describes the final code.
Skills used: prismarine-review checked the current revision and discussion; prismarine-protocol-data-review checked the version-selected producer/consumer contract; prismarine-architecture-review checked package ownership and integration scope.
* Add version 26.2 * fix 26.2 build (PrismarineJS#78) * Add 26.3 module, copied from 26.2 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mc/26.3: port to the 26.3 API RedStoneWireBlock is now RedstoneWireBlock, and the SKY_COLOR environment attribute holds a Vector3fc instead of a packed int; convert it with ARGB.colorFromVector3f. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mc/26.3: water and lava are not diggable Same fix PrismarineJS#80 applied to the other modules: fluid blocks report hardness 100, so diggable was true. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mc/26.3: skip incorrect_for_* when picking a block's material Port of PrismarineJS#86: tier-gated blocks (iron ore, obsidian, ...) reported incorrect_for_wooden_tool, whose speed table only has wooden tools, so dig times fell back to hand speed. Also adds the plant;mineable/hoe and sword_instantly_mines;mineable/axe composites. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mc/26.3: copper tools have speed 5 Port of PrismarineJS#87: copper was missing from the speed table, so copper tools got 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mc-zuri <174940476+mc-zuri@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Fixes water/lava being marked
diggable: true.The bug
The
diggablelogic ishardness != -1.0f && !(block instanceof AirBlock). Fluids have a hardness of 100 (not -1), so water and lava were incorrectly marked diggable in every version that has fluid blocks.The fix
Detect fluid blocks from the game code instead of hardcoding names — per @extremeheat's guidance on #79:
defaultState.getFluidState().isEmpty()— a block is diggable only if its default state has no fluid.Material.isFluid()—!block.getMaterial().isFluid()for 1.7/1.8.9,!defaultState.getMaterial().isFluid()for 1.9.4–1.12.2.No block names are hardcoded; the check queries the actual Minecraft source.
Verification
Every API was confirmed against the real mapping files for its era (Yarn v2 tiny mappings for 1.14/1.15/1.16/1.20, legacyYarn for 1.7–1.13, Mojmap for 1.21.5+):
BlockState.getFluidState()(no-arg) exists from 1.13 onward (onAbstractBlock.AbstractBlockState, inherited byBlockState).FluidState.isEmpty()exists in all those versions.Material.isFluid()exists in all legacyYarn versions.CI runs
runServerfor all 28 versions, which compiles and executes each generator, so any wrong API will fail the build.