Skip to content

Commit

Permalink
world/world.go: Don't remove liquid if replacing block is displacer
Browse files Browse the repository at this point in the history
  • Loading branch information
DaPigGuy committed Jan 26, 2025
1 parent ed8edb8 commit ed5ca3d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions server/world/world.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,13 @@ func (w *World) setBlock(pos cube.Pos, b Block, opts *SetOpts) {
secondLayer = air()
b = blockByRuntimeIDOrAir(li)
}
} else if liquidDisplacingBlocks[rid] && liquidBlocks[before] {
l := blockByRuntimeIDOrAir(before)
if b.(LiquidDisplacer).CanDisplace(l.(Liquid)) {
c.SetBlock(x, y, z, 1, before)
secondLayer = l
} else if liquidDisplacingBlocks[rid] {
if liquidBlocks[before] {
l := blockByRuntimeIDOrAir(before)
if b.(LiquidDisplacer).CanDisplace(l.(Liquid)) {
c.SetBlock(x, y, z, 1, before)
secondLayer = l
}
}
} else if li := c.Block(x, y, z, 1); li != airRID {
c.SetBlock(x, y, z, 1, airRID)
Expand Down

0 comments on commit ed5ca3d

Please sign in to comment.