diff --git a/server/block/break_info.go b/server/block/break_info.go index 7be767c81..bfe74b641 100644 --- a/server/block/break_info.go +++ b/server/block/break_info.go @@ -248,6 +248,12 @@ func breakBlock(b world.Block, pos cube.Pos, tx *world.Tx) { } func breakBlockNoDrops(b world.Block, pos cube.Pos, tx *world.Tx) { + if breakable, ok := b.(Breakable); ok { + breakHandler := breakable.BreakInfo().BreakHandler + if breakHandler != nil { + breakHandler(pos, tx, nil) + } + } tx.SetBlock(pos, nil, nil) tx.AddParticle(pos.Vec3Centre(), particle.BlockBreak{Block: b}) } diff --git a/server/block/explosion.go b/server/block/explosion.go index de4495365..52f07c6e2 100644 --- a/server/block/explosion.go +++ b/server/block/explosion.go @@ -137,27 +137,16 @@ func (c ExplosionConfig) Explode(tx *world.Tx, explosionPos mgl64.Vec3) { if explodable, ok := bl.(Explodable); ok { explodable.Explode(explosionPos, pos, tx, c) } else if breakable, ok := bl.(Breakable); ok { + breakHandler := breakable.BreakInfo().BreakHandler + if breakHandler != nil { + breakHandler(pos, tx, nil) + } tx.SetBlock(pos, nil, nil) if c.ItemDropChance > r.Float64() { for _, drop := range breakable.BreakInfo().Drops(item.ToolNone{}, nil) { dropItem(tx, drop, pos.Vec3Centre()) } } - - if container, ok := bl.(Container); ok { - if cb, ok := bl.(Chest); ok { - if cb.Paired() { - pairPos := cb.pairPos(pos) - if _, pair, ok := cb.unpair(tx, pos); ok { - cb.paired = false - tx.SetBlock(pairPos, pair, nil) - } - } - } - for _, i := range container.Inventory(tx, pos).Clear() { - dropItem(tx, i, pos.Vec3()) - } - } } } if c.SpawnFire {