Add support for protocol version 1.21.100 (#12)
This commit is contained in:
@@ -2,32 +2,33 @@ package legacyver
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
|
||||
"github.com/akmalfairuz/legacy-version/internal/chunk"
|
||||
"github.com/akmalfairuz/legacy-version/legacyver/proto"
|
||||
"github.com/akmalfairuz/legacy-version/mapping"
|
||||
)
|
||||
|
||||
const (
|
||||
// ItemVersion819 ...
|
||||
ItemVersion819 = 271
|
||||
ItemVersion819 = 261
|
||||
// BlockVersion819 ...
|
||||
BlockVersion819 int32 = (1 << 24) | (21 << 16) | (90 << 8)
|
||||
)
|
||||
|
||||
var (
|
||||
//go:embed data/dragonfly_items.json
|
||||
dragonflyLatestItemList []byte
|
||||
//go:embed data/required_item_list_819.json
|
||||
requiredItemList819 []byte
|
||||
//go:embed data/block_states_819.nbt
|
||||
blockStateData819 []byte
|
||||
|
||||
itemMappingLatestPocketMine = mapping.NewItemMapping(requiredItemList819, ItemVersion819)
|
||||
itemMappingLatestDragonfly = mapping.NewItemMapping(dragonflyLatestItemList, ItemVersion819)
|
||||
blockMappingLatest = mapping.NewBlockMapping(blockStateData819)
|
||||
)
|
||||
|
||||
func itemMappingLatest(dragonflyMapping bool) mapping.Item {
|
||||
if dragonflyMapping {
|
||||
return itemMappingLatestDragonfly
|
||||
func New819(dragonflyMapping bool) *Protocol {
|
||||
itemMapping := mapping.NewItemMapping(requiredItemList819, ItemVersion819)
|
||||
blockMapping := mapping.NewBlockMapping(blockStateData819)
|
||||
return &Protocol{
|
||||
ver: "1.21.90",
|
||||
id: proto.ID819,
|
||||
blockTranslator: NewBlockTranslator(blockMapping, blockMappingLatest, chunk.NewNetworkPersistentEncoding(blockMapping, BlockVersion819), chunk.NewBlockPaletteEncoding(blockMapping, BlockVersion819), false),
|
||||
itemTranslator: NewItemTranslator(itemMapping, itemMappingLatest(dragonflyMapping), blockMapping, blockMappingLatest),
|
||||
}
|
||||
return itemMappingLatestPocketMine
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user