Remove SetItemRuntimeID method and update item mapping initialization
This commit is contained in:
10898
legacyver/data/dragonfly_items.json
Normal file
10898
legacyver/data/dragonfly_items.json
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -3,7 +3,6 @@ package legacyver
|
||||
import (
|
||||
_ "embed"
|
||||
"github.com/akmalfairuz/legacy-version/mapping"
|
||||
"github.com/sandertv/gophertunnel/minecraft/nbt"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -18,30 +17,14 @@ var (
|
||||
requiredItemList818 []byte
|
||||
//go:embed data/block_states_818.nbt
|
||||
blockStateData818 []byte
|
||||
//go:embed data/dragonfly_latest_vanilla_items.nbt
|
||||
dragonflyLatestVanillaItemsRaw []byte
|
||||
|
||||
dragonflyLatestItemList []byte = requiredItemList818
|
||||
|
||||
itemMappingLatestPocketMine = mapping.NewItemMapping(requiredItemList818, ItemVersion818)
|
||||
itemMappingLatestDragonfly = mapping.NewItemMapping(requiredItemList818, ItemVersion818)
|
||||
itemMappingLatestDragonfly = mapping.NewItemMapping(dragonflyLatestItemList, ItemVersion818)
|
||||
blockMappingLatest = mapping.NewBlockMapping(blockStateData818)
|
||||
)
|
||||
|
||||
func init() {
|
||||
var m map[string]struct {
|
||||
RuntimeID int32 `nbt:"runtime_id"`
|
||||
ComponentBased bool `nbt:"component_based"`
|
||||
Version int32 `nbt:"version"`
|
||||
Data map[string]any `nbt:"data,omitempty"`
|
||||
}
|
||||
if err := nbt.Unmarshal(dragonflyLatestVanillaItemsRaw, &m); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
for identifier, v := range m {
|
||||
itemMappingLatestDragonfly.SetItemRuntimeID(identifier, v.RuntimeID)
|
||||
}
|
||||
}
|
||||
|
||||
func itemMappingLatest(dragonflyMapping bool) mapping.Item {
|
||||
if dragonflyMapping {
|
||||
return itemMappingLatestDragonfly
|
||||
|
||||
Reference in New Issue
Block a user