1.21.120 support
This commit is contained in:
@@ -3,6 +3,7 @@ package legacyver
|
||||
import (
|
||||
_ "embed"
|
||||
|
||||
"github.com/akmalfairuz/legacy-version/legacyver/proto"
|
||||
"github.com/akmalfairuz/legacy-version/mapping"
|
||||
)
|
||||
|
||||
@@ -10,25 +11,23 @@ const (
|
||||
// ItemVersion844 ...
|
||||
ItemVersion844 = 241
|
||||
// BlockVersion844 ...
|
||||
BlockVersion844 int32 = (1 << 24) | (21 << 16) | (110 << 8)
|
||||
BlockVersion844 int32 = (1 << 24) | (21 << 16) | (111 << 8)
|
||||
)
|
||||
|
||||
var (
|
||||
//go:embed data/dragonfly_items.json
|
||||
dragonflyLatestItemList []byte
|
||||
//go:embed data/required_item_list_844.json
|
||||
requiredItemList844 []byte
|
||||
//go:embed data/block_states_844.nbt
|
||||
blockStateData844 []byte
|
||||
|
||||
itemMappingLatestPocketMine = mapping.NewItemMapping(requiredItemList844, ItemVersion844)
|
||||
itemMappingLatestDragonfly = mapping.NewItemMapping(dragonflyLatestItemList, ItemVersion844)
|
||||
blockMappingLatest = mapping.NewBlockMapping(blockStateData844)
|
||||
)
|
||||
|
||||
func itemMappingLatest(dragonflyMapping bool) mapping.Item {
|
||||
if dragonflyMapping {
|
||||
return itemMappingLatestDragonfly
|
||||
func New844(dragonflyMapping bool) *Protocol {
|
||||
itemMapping := mapping.NewItemMapping(requiredItemList844, ItemVersion844)
|
||||
blockTranslator := lookupOrCreateBlockTranslator(844, BlockVersion844, blockStateData844)
|
||||
return &Protocol{
|
||||
ver: "1.21.111",
|
||||
id: proto.ID844,
|
||||
blockTranslator: blockTranslator,
|
||||
itemTranslator: NewItemTranslator(itemMapping, itemMappingLatest(dragonflyMapping), blockTranslator.BlockMapping(), blockMappingLatest),
|
||||
}
|
||||
return itemMappingLatestPocketMine
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user