Skip to content

Commit

Permalink
block/decorated_pot.go: Fix dropping decorated pot (#823)
Browse files Browse the repository at this point in the history
  • Loading branch information
sqmatheus authored Nov 2, 2023
1 parent 67786cd commit 954b3d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/block/decorated_pot.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"github.com/df-mc/dragonfly/server/block/cube"
"github.com/df-mc/dragonfly/server/block/model"
"github.com/df-mc/dragonfly/server/internal/nbtconv"
"github.com/df-mc/dragonfly/server/item"
"github.com/df-mc/dragonfly/server/world"
"github.com/go-gl/mathgl/mgl64"
Expand Down Expand Up @@ -82,8 +83,8 @@ func (p DecoratedPot) EncodeNBT() map[string]any {
// DecodeNBT ...
func (p DecoratedPot) DecodeNBT(data map[string]any) any {
p.Decorations = [4]PotDecoration{}
if sherds, ok := data["sherds"]; ok {
for i, name := range sherds.([]any) {
if sherds := nbtconv.Slice(data, "sherds"); sherds != nil {
for i, name := range sherds {
it, ok := world.ItemByName(name.(string), 0)
if !ok {
panic(fmt.Errorf("unknown item %s", name))
Expand Down

0 comments on commit 954b3d5

Please sign in to comment.