Skip to content

Commit 770be27

Browse files
committed
block/campfire.go: Drop on break without NBT
1 parent a141754 commit 770be27

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

server/block/campfire.go

+10-11
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,22 @@ func (Campfire) SideClosed(cube.Pos, cube.Pos, *world.Tx) bool {
5151
// BreakInfo ...
5252
func (c Campfire) BreakInfo() BreakInfo {
5353
return newBreakInfo(2, alwaysHarvestable, axeEffective, func(t item.Tool, enchantments []item.Enchantment) []item.Stack {
54-
var drops []item.Stack
5554
if hasSilkTouch(enchantments) {
56-
drops = append(drops, item.NewStack(c, 1))
57-
} else {
58-
switch c.Type {
59-
case NormalFire():
60-
drops = append(drops, item.NewStack(item.Charcoal{}, 2))
61-
case SoulFire():
62-
drops = append(drops, item.NewStack(SoulSoil{}, 1))
63-
}
55+
return []item.Stack{item.NewStack(Campfire{Type: c.Type}, 1)}
56+
}
57+
switch c.Type {
58+
case NormalFire():
59+
return []item.Stack{item.NewStack(item.Charcoal{}, 2)}
60+
case SoulFire():
61+
return []item.Stack{item.NewStack(SoulSoil{}, 1)}
6462
}
63+
panic("should never happen")
64+
}).withBreakHandler(func(pos cube.Pos, tx *world.Tx, u item.User) {
6565
for _, v := range c.Items {
6666
if !v.Item.Empty() {
67-
drops = append(drops, v.Item)
67+
dropItem(tx, v.Item, pos.Vec3Centre())
6868
}
6969
}
70-
return drops
7170
})
7271
}
7372

0 commit comments

Comments
 (0)