Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion server/block/shulker_box.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,15 @@ func shulkerPushDelta(facing cube.Face, shulkerBBox, entityBBox cube.BBox) (delt
}

func (s ShulkerBox) BreakInfo() BreakInfo {
return newBreakInfo(2, alwaysHarvestable, pickaxeEffective, oneOf(s))
return newBreakInfo(2, alwaysHarvestable, pickaxeEffective,
func(_ item.Tool, _ []item.Enchantment) []item.Stack { return nil }).
// shulker box always has a drop, except when player in creative breaks empty box.
withBreakHandler(func(pos cube.Pos, tx *world.Tx, u item.User) {
if u != nil && u.GameMode().CreativeInventory() && s.Inventory(tx, pos).Empty() {
return
}
dropItem(tx, item.NewStack(s, 1), pos.Vec3Centre())
})
}

func (s ShulkerBox) MaxCount() int {
Expand Down
1 change: 1 addition & 0 deletions server/item/item.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ type User interface {
UsingItem() bool
ReleaseItem()
UseItem()
GameMode() world.GameMode
}

// Carrier represents an entity that is able to carry an item.
Expand Down