Skip to content

Commit

Permalink
block/decorated_pot.go: Shatter on projectile hit
Browse files Browse the repository at this point in the history
  • Loading branch information
DaPigGuy committed Jan 7, 2025
1 parent 2708cc8 commit 5532f49
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions server/block/decorated_pot.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ type DecoratedPot struct {
Decorations [4]PotDecoration
}

// ProjectileHit ...
func (p DecoratedPot) ProjectileHit(pos cube.Pos, tx *world.Tx, _ world.Entity, _ cube.Face) {
for _, d := range p.Decorations {
if d == nil {
dropItem(tx, item.NewStack(item.Brick{}, 1), pos.Vec3Centre())
continue
}
dropItem(tx, item.NewStack(d, 1), pos.Vec3Centre())
}
breakBlockNoDrops(p, pos, tx)
}

// Pick ...
func (p DecoratedPot) Pick() item.Stack {
return item.NewStack(DecoratedPot{Decorations: p.Decorations}, 1)
Expand Down

0 comments on commit 5532f49

Please sign in to comment.