diff --git a/go.mod b/go.mod index 2ddcd82da..5cf86efd2 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/google/uuid v1.4.0 github.com/pelletier/go-toml v1.9.5 github.com/rogpeppe/go-internal v1.11.0 - github.com/sandertv/gophertunnel v1.36.0 + github.com/sandertv/gophertunnel v1.37.0 github.com/segmentio/fasthash v1.0.3 github.com/sirupsen/logrus v1.9.3 golang.org/x/exp v0.0.0-20230206171751-46f607a40771 diff --git a/go.sum b/go.sum index 8f4496d7c..dc708b465 100644 --- a/go.sum +++ b/go.sum @@ -50,8 +50,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/sandertv/go-raknet v1.12.0 h1:olUzZlIJyX/pgj/mrsLCZYjKLNDsYiWdvQ4NIm3z0DA= github.com/sandertv/go-raknet v1.12.0/go.mod h1:Gx+WgZBMQ0V2UoouGoJ8Wj6CDrMBQ4SB2F/ggpl5/+Y= -github.com/sandertv/gophertunnel v1.36.0 h1:VF2znM3FFUkPqOVnOeH0KgM5iI167AzSB2oqLxrn2F4= -github.com/sandertv/gophertunnel v1.36.0/go.mod h1:4El8ZfEpUmOMIJhPt5SCc1PyLNiuQ2+grWczrBvSGVs= +github.com/sandertv/gophertunnel v1.37.0 h1:yPzOp4W1GahLjtxldXa5K25saJK/XG7SiyEt6oMjm0I= +github.com/sandertv/gophertunnel v1.37.0/go.mod h1:4El8ZfEpUmOMIJhPt5SCc1PyLNiuQ2+grWczrBvSGVs= github.com/segmentio/fasthash v1.0.3 h1:EI9+KE1EwvMLBWwjpRDc+fEM+prwxDYbslddQGtrmhM= github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= diff --git a/server/block/flower.go b/server/block/flower.go index 55f7b1a1a..be848e53c 100644 --- a/server/block/flower.go +++ b/server/block/flower.go @@ -105,22 +105,12 @@ func (Flower) CompostChance() float64 { // EncodeItem ... func (f Flower) EncodeItem() (name string, meta int16) { - if f.Type == Dandelion() { - return "minecraft:yellow_flower", 0 - } else if f.Type == WitherRose() { - return "minecraft:wither_rose", 0 - } - return "minecraft:red_flower", int16(f.Type.Uint8() - 1) + return "minecraft:" + f.Type.String(), 0 } // EncodeBlock ... func (f Flower) EncodeBlock() (string, map[string]any) { - if f.Type == Dandelion() { - return "minecraft:yellow_flower", nil - } else if f.Type == WitherRose() { - return "minecraft:wither_rose", nil - } - return "minecraft:red_flower", map[string]any{"flower_type": f.Type.String()} + return "minecraft:" + f.Type.String(), nil } // allFlowers ... diff --git a/server/block/flower_type.go b/server/block/flower_type.go index a5a7d1082..10c14a237 100644 --- a/server/block/flower_type.go +++ b/server/block/flower_type.go @@ -114,25 +114,25 @@ func (f flower) Name() string { func (f flower) String() string { switch f { case 0: - return "dandelion" + return "yellow_flower" case 1: return "poppy" case 2: - return "orchid" + return "blue_orchid" case 3: return "allium" case 4: - return "houstonia" + return "azure_bluet" case 5: - return "tulip_red" + return "red_tulip" case 6: - return "tulip_orange" + return "orange_tulip" case 7: - return "tulip_white" + return "white_tulip" case 8: - return "tulip_pink" + return "pink_tulip" case 9: - return "oxeye" + return "oxeye_daisy" case 10: return "cornflower" case 11: diff --git a/server/item/creative/creative_items.nbt b/server/item/creative/creative_items.nbt index 1498955a7..8cb2f4c02 100644 Binary files a/server/item/creative/creative_items.nbt and b/server/item/creative/creative_items.nbt differ diff --git a/server/item/recipe/crafting_data.nbt b/server/item/recipe/crafting_data.nbt index 60cfabf5c..0139383bb 100644 Binary files a/server/item/recipe/crafting_data.nbt and b/server/item/recipe/crafting_data.nbt differ diff --git a/server/item/recipe/smithing_data.nbt b/server/item/recipe/smithing_data.nbt index eb0deadad..f101dbb30 100644 Binary files a/server/item/recipe/smithing_data.nbt and b/server/item/recipe/smithing_data.nbt differ diff --git a/server/item/recipe/stonecutter_data.nbt b/server/item/recipe/stonecutter_data.nbt deleted file mode 100644 index 1db76b81c..000000000 Binary files a/server/item/recipe/stonecutter_data.nbt and /dev/null differ diff --git a/server/item/recipe/vanilla.go b/server/item/recipe/vanilla.go index 20203e760..af3a9dd07 100644 --- a/server/item/recipe/vanilla.go +++ b/server/item/recipe/vanilla.go @@ -13,8 +13,6 @@ var ( vanillaCraftingData []byte //go:embed smithing_data.nbt vanillaSmithingData []byte - //go:embed stonecutter_data.nbt - vanillaStonecutterData []byte ) // shapedRecipe is a recipe that must be crafted in a specific shape. @@ -44,12 +42,7 @@ func init() { panic(err) } - var stonecutterRecipes []shapelessRecipe - if err := nbt.Unmarshal(vanillaStonecutterData, &stonecutterRecipes); err != nil { - panic(err) - } - - for _, s := range append(craftingRecipes.Shapeless, stonecutterRecipes...) { + for _, s := range append(craftingRecipes.Shapeless) { input, ok := s.Input.Items() output, okTwo := s.Output.Stacks() if !ok || !okTwo { diff --git a/server/session/handler_crafting.go b/server/session/handler_crafting.go index 26aec3235..a17133775 100644 --- a/server/session/handler_crafting.go +++ b/server/session/handler_crafting.go @@ -203,6 +203,9 @@ func matchingStacks(has, expected recipe.Item) bool { switch expected := expected.(type) { case item.Stack: switch has := has.(type) { + case recipe.ItemTag: + name, _ := expected.Item().EncodeItem() + return has.Contains(name) case item.Stack: _, variants := expected.Value("variants") if !variants { diff --git a/server/world/block_states.nbt b/server/world/block_states.nbt index c1cbd97c2..83c833fa3 100644 Binary files a/server/world/block_states.nbt and b/server/world/block_states.nbt differ diff --git a/server/world/item_runtime_ids.nbt b/server/world/item_runtime_ids.nbt index aef793236..7fdf69bc1 100644 Binary files a/server/world/item_runtime_ids.nbt and b/server/world/item_runtime_ids.nbt differ diff --git a/server/world/mcdb/leveldat/data.go b/server/world/mcdb/leveldat/data.go index 24713aca7..a944f95ae 100644 --- a/server/world/mcdb/leveldat/data.go +++ b/server/world/mcdb/leveldat/data.go @@ -142,6 +142,7 @@ type Data struct { NaturalGeneration bool `nbt:"naturalgeneration"` ProjectilesCanBreakBlocks bool `nbt:"projectilescanbreakblocks"` ShowRecipeMessages bool `nbt:"showrecipemessages"` + IsHardcore bool `nbt:"IsHardcore"` } // FillDefault fills out d with all the default level.dat values.