Skip to content

Commit ee9265a

Browse files
committed
fix(ores): pass whitelist to set_block_absolute so STONE actually gets overwritten
The previous ore placement called set_block_absolute(ore, x, y, z, None, None) which silently no-ops over any non-AIR block. set_block_with_properties_absolute at mod.rs:892 routes to an else { false } branch when there is an existing block and no filters are given. So every vein step that landed on stone was a no-op. Passing Some(&[STONE]) as the whitelist makes the existing-block path match and write. The earlier check_for_block_absolute pre-gate is kept because, when the target cell is AIR, the same function's else { true } branch would otherwise write ore into the air above the surface.
1 parent d4bdb52 commit ee9265a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/ore_generation.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ pub fn generate_ores(editor: &mut WorldEditor, xzbbox: &XZBBox) {
110110
}
111111
}
112112

113-
// 3D random walk that replaces STONE only — any other block ends the placement
114-
// at that step (next step continues from the new position).
113+
// Whitelist on set_block_absolute is required to overwrite STONE; pre-check filters AIR.
115114
fn place_vein(
116115
editor: &mut WorldEditor,
117116
block: Block,
@@ -124,7 +123,7 @@ fn place_vein(
124123
let (mut cx, mut cy, mut cz) = (x, y, z);
125124
for _ in 0..size {
126125
if editor.check_for_block_absolute(cx, cy, cz, Some(&[STONE]), None) {
127-
editor.set_block_absolute(block, cx, cy, cz, None, None);
126+
editor.set_block_absolute(block, cx, cy, cz, Some(&[STONE]), None);
128127
}
129128
match rng.random_range(0..6) {
130129
0 => cx += 1,

0 commit comments

Comments
 (0)