Skip to content

Commit

Permalink
block/block.go: Also check liquid in replaceableWith
Browse files Browse the repository at this point in the history
  • Loading branch information
DaPigGuy committed Jan 26, 2025
1 parent ed5ca3d commit 34ad7db
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/block/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,14 @@ func replaceableWith(tx *world.Tx, pos cube.Pos, with world.Block) bool {
}
b := tx.Block(pos)
if replaceable, ok := b.(Replaceable); ok {
return replaceable.ReplaceableBy(with) && b != with
if !replaceable.ReplaceableBy(with) || b == with {
return false
}
if liquid, ok := tx.Liquid(pos); ok {
replaceable, ok := liquid.(Replaceable)
return ok && replaceable.ReplaceableBy(with)
}
return true
}
return false
}
Expand Down

0 comments on commit 34ad7db

Please sign in to comment.