legacyver

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2025 License: GPL-3.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ItemVersion649 ...
	ItemVersion649 = 161
	// BlockVersion649 ...
	BlockVersion649 int32 = (1 << 24) | (20 << 16) | (60 << 8)
)
View Source
const (
	// ItemVersion662 ...
	ItemVersion662 = 171
	// BlockVersion662 ...
	BlockVersion662 int32 = (1 << 24) | (20 << 16) | (70 << 8)
)
View Source
const (
	// ItemVersion671 ...
	ItemVersion671 = 181
	// BlockVersion671 ...
	BlockVersion671 int32 = (1 << 24) | (20 << 16) | (80 << 8)
)
View Source
const (
	// ItemVersion685 ...
	ItemVersion685 = 191
	// BlockVersion685 ...
	BlockVersion685 int32 = (1 << 24) | (21 << 16) | (0 << 8)
)
View Source
const (
	// ItemVersion686 ...
	ItemVersion686 = 191
	// BlockVersion686 ...
	BlockVersion686 int32 = (1 << 24) | (21 << 16) | (2 << 8)
)
View Source
const (
	// ItemVersion712 ...
	ItemVersion712 = 201
	// BlockVersion712 ...
	BlockVersion712 int32 = (1 << 24) | (21 << 16) | (20 << 8)
)
View Source
const (
	// ItemVersion729 ...
	ItemVersion729 = 211
	// BlockVersion729 ...
	BlockVersion729 int32 = (1 << 24) | (21 << 16) | (30 << 8)
)
View Source
const (
	// ItemVersion748 ...
	ItemVersion748 = 221
	// BlockVersion748 ...
	BlockVersion748 int32 = (1 << 24) | (21 << 16) | (40 << 8)
)
View Source
const (
	// ItemVersion766 ...
	ItemVersion766 = 221
	// BlockVersion766 ...
	BlockVersion766 int32 = (1 << 24) | (21 << 16) | (50 << 8)
)
View Source
const (
	// ItemVersion776 ...
	ItemVersion776 = 241
	// BlockVersion776 ...
	BlockVersion776 int32 = (1 << 24) | (21 << 16) | (60 << 8)
)
View Source
const (
	// ItemVersion786 ...
	ItemVersion786 = 241
	// BlockVersion786 ...
	BlockVersion786 int32 = (1 << 24) | (21 << 16) | (70 << 8)
)
View Source
const (
	// ItemVersion800 ...
	ItemVersion800 = 251
	// BlockVersion800 ...
	BlockVersion800 int32 = (1 << 24) | (21 << 16) | (80 << 8)
)
View Source
const (
	// ItemVersion818 ...
	ItemVersion818 = 261
	// BlockVersion818 ...
	BlockVersion818 int32 = (1 << 24) | (21 << 16) | (90 << 8)
)
View Source
const (
	// ItemVersion819 ...
	ItemVersion819 = 261
	// BlockVersion819 ...
	BlockVersion819 int32 = (1 << 24) | (21 << 16) | (90 << 8)
)
View Source
const (
	// ItemVersion827 ...
	ItemVersion827 = 271
	// BlockVersion827 ...
	BlockVersion827 int32 = (1 << 24) | (21 << 16) | (100 << 8)
)
View Source
const (
	BlockVersionLatest int32 = (1 << 24) | (21 << 16) | (50 << 8) | 29
)

Variables

View Source
var (
	// LatestNetworkPersistentEncoding is the Encoding used for sending a Chunk over network. It uses NBT, unlike NetworkEncoding.
	LatestNetworkPersistentEncoding = chunk.NewNetworkPersistentEncoding(blockMappingLatest, BlockVersionLatest)
	// LatestBlockPaletteEncoding is the paletteEncoding used for encoding a palette of block states encoded as NBT.
	LatestBlockPaletteEncoding = chunk.NewBlockPaletteEncoding(blockMappingLatest, BlockVersionLatest)
)

Functions

func All added in v1.2.0

func All(dragonflyMapping bool) []minecraft.Protocol

All returns a slice of all legacy protocol versions that are supported. dragonflyMapping must be set to true if you're using Dragonfly.

Types

type BlockTranslator

type BlockTranslator interface {
	// DowngradeBlockPackets downgrades the input block packets to legacy block packets.
	DowngradeBlockPackets([]packet.Packet, *minecraft.Conn) (result []packet.Packet)
	// UpgradeBlockPackets upgrades the input block packets to the latest block packets.
	UpgradeBlockPackets([]packet.Packet, *minecraft.Conn) (result []packet.Packet)
}

type DefaultBlockTranslator

type DefaultBlockTranslator struct {
	// contains filtered or unexported fields
}

func NewBlockTranslator

func NewBlockTranslator(mapping mapping.Block, latestMapping mapping.Block, pse chunk.Encoding, pe chunk.PaletteEncoding, oldFormat bool) *DefaultBlockTranslator

func (*DefaultBlockTranslator) DowngradeBlockPackets

func (t *DefaultBlockTranslator) DowngradeBlockPackets(pks []packet.Packet, conn *minecraft.Conn) (result []packet.Packet)

func (*DefaultBlockTranslator) DowngradeBlockRuntimeID

func (t *DefaultBlockTranslator) DowngradeBlockRuntimeID(input uint32) uint32

func (*DefaultBlockTranslator) DowngradeChunk

func (t *DefaultBlockTranslator) DowngradeChunk(input *chunk.Chunk) *chunk.Chunk

func (*DefaultBlockTranslator) DowngradeSubChunk

func (t *DefaultBlockTranslator) DowngradeSubChunk(input *chunk.SubChunk)

func (*DefaultBlockTranslator) UpgradeBlockPackets

func (t *DefaultBlockTranslator) UpgradeBlockPackets(pks []packet.Packet, conn *minecraft.Conn) (result []packet.Packet)

func (*DefaultBlockTranslator) UpgradeBlockRuntimeID

func (t *DefaultBlockTranslator) UpgradeBlockRuntimeID(input uint32) uint32

type DefaultItemTranslator

type DefaultItemTranslator struct {
	// contains filtered or unexported fields
}

func NewItemTranslator

func NewItemTranslator(mapping mapping.Item, latestMapping mapping.Item, blockMapping mapping.Block, blockMappingLatest mapping.Block) *DefaultItemTranslator

func (*DefaultItemTranslator) CustomItems

func (t *DefaultItemTranslator) CustomItems() map[int32]world.CustomItem

func (*DefaultItemTranslator) DowngradeItemDescriptor

func (t *DefaultItemTranslator) DowngradeItemDescriptor(input protocol.ItemDescriptor) protocol.ItemDescriptor

func (*DefaultItemTranslator) DowngradeItemDescriptorCount

func (t *DefaultItemTranslator) DowngradeItemDescriptorCount(input protocol.ItemDescriptorCount) protocol.ItemDescriptorCount

func (*DefaultItemTranslator) DowngradeItemEntries added in v1.1.1

func (t *DefaultItemTranslator) DowngradeItemEntries(entries []proto.ItemEntry) []proto.ItemEntry

func (*DefaultItemTranslator) DowngradeItemInstance

func (t *DefaultItemTranslator) DowngradeItemInstance(input protocol.ItemInstance) protocol.ItemInstance

func (*DefaultItemTranslator) DowngradeItemPackets

func (t *DefaultItemTranslator) DowngradeItemPackets(pks []packet.Packet, _ *minecraft.Conn) (result []packet.Packet)

func (*DefaultItemTranslator) DowngradeItemStack

func (t *DefaultItemTranslator) DowngradeItemStack(input protocol.ItemStack) protocol.ItemStack

func (*DefaultItemTranslator) DowngradeItemType

func (t *DefaultItemTranslator) DowngradeItemType(input protocol.ItemType) protocol.ItemType

func (*DefaultItemTranslator) DowngradeLegacyItemRegistry added in v1.1.0

func (t *DefaultItemTranslator) DowngradeLegacyItemRegistry(entries []proto.LegacyItemRegistryEntry) []proto.LegacyItemRegistryEntry

func (*DefaultItemTranslator) Register

func (t *DefaultItemTranslator) Register(item world.CustomItem, replacement string)

func (*DefaultItemTranslator) UpgradeItemDescriptor

func (t *DefaultItemTranslator) UpgradeItemDescriptor(input protocol.ItemDescriptor) protocol.ItemDescriptor

func (*DefaultItemTranslator) UpgradeItemDescriptorCount

func (t *DefaultItemTranslator) UpgradeItemDescriptorCount(input protocol.ItemDescriptorCount) protocol.ItemDescriptorCount

func (*DefaultItemTranslator) UpgradeItemEntries added in v1.1.1

func (t *DefaultItemTranslator) UpgradeItemEntries(entries []proto.ItemEntry) []proto.ItemEntry

func (*DefaultItemTranslator) UpgradeItemInstance

func (t *DefaultItemTranslator) UpgradeItemInstance(input protocol.ItemInstance) protocol.ItemInstance

func (*DefaultItemTranslator) UpgradeItemPackets

func (t *DefaultItemTranslator) UpgradeItemPackets(pks []packet.Packet, _ *minecraft.Conn) (result []packet.Packet)

func (*DefaultItemTranslator) UpgradeItemStack

func (t *DefaultItemTranslator) UpgradeItemStack(input protocol.ItemStack) protocol.ItemStack

func (*DefaultItemTranslator) UpgradeItemType

func (t *DefaultItemTranslator) UpgradeItemType(input protocol.ItemType) protocol.ItemType

func (*DefaultItemTranslator) UpgradeLegacyItemRegistry added in v1.1.0

func (t *DefaultItemTranslator) UpgradeLegacyItemRegistry(entries []proto.LegacyItemRegistryEntry) []proto.LegacyItemRegistryEntry

type ItemTranslator

type ItemTranslator interface {
	// DowngradeItemType downgrades the input item type to a legacy item type.
	DowngradeItemType(input protocol.ItemType) protocol.ItemType
	// DowngradeItemStack downgrades the input item stack to a legacy item stack.
	DowngradeItemStack(input protocol.ItemStack) protocol.ItemStack
	// DowngradeItemInstance downgrades the input item instance to a legacy item instance.
	DowngradeItemInstance(input protocol.ItemInstance) protocol.ItemInstance
	// DowngradeItemDescriptor downgrades the input item descriptor to a legacy item descriptor.
	DowngradeItemDescriptor(input protocol.ItemDescriptor) protocol.ItemDescriptor
	// DowngradeItemDescriptorCount downgrades the input item descriptor (with count) to a legacy item descriptor (with count).
	DowngradeItemDescriptorCount(input protocol.ItemDescriptorCount) protocol.ItemDescriptorCount
	DowngradeItemPackets(pks []packet.Packet, conn *minecraft.Conn) []packet.Packet
	// UpgradeItemType upgrades the input item type to the latest item type.
	UpgradeItemType(input protocol.ItemType) protocol.ItemType
	// UpgradeItemStack upgrades the input item stack to the latest item stack.
	UpgradeItemStack(input protocol.ItemStack) protocol.ItemStack
	// UpgradeItemInstance upgrades the input item instance to the latest item instance.
	UpgradeItemInstance(input protocol.ItemInstance) protocol.ItemInstance
	// UpgradeItemDescriptor upgrades the input item descriptor to the latest item descriptor.
	UpgradeItemDescriptor(input protocol.ItemDescriptor) protocol.ItemDescriptor
	// UpgradeItemDescriptorCount upgrades the input item descriptor (with count) to the latest item descriptor (with count).
	UpgradeItemDescriptorCount(input protocol.ItemDescriptorCount) protocol.ItemDescriptorCount
	UpgradeItemPackets(pks []packet.Packet, conn *minecraft.Conn) []packet.Packet
	// Register registers a custom item entry.
	Register(item world.CustomItem, replacement string)
	// CustomItems lists all custom items used as substitutes, with the runtime id as the key
	CustomItems() map[int32]world.CustomItem
	// DowngradeLegacyItemRegistry ...
	DowngradeLegacyItemRegistry(entries []proto.LegacyItemRegistryEntry) []proto.LegacyItemRegistryEntry
	// UpgradeLegacyItemRegistry ...
	UpgradeLegacyItemRegistry(entries []proto.LegacyItemRegistryEntry) []proto.LegacyItemRegistryEntry
	// DowngradeItemEntries ...
	DowngradeItemEntries(entries []proto.ItemEntry) []proto.ItemEntry
	// UpgradeItemEntries ...
	UpgradeItemEntries(entries []proto.ItemEntry) []proto.ItemEntry
}

type Protocol

type Protocol struct {
	// contains filtered or unexported fields
}

func New649 added in v1.3.0

func New649(dragonflyMapping bool) *Protocol

New649 ...

func New662 added in v1.3.0

func New662(dragonflyMapping bool) *Protocol

New662 ...

func New671 added in v1.0.0

func New671(dragonflyMapping bool) *Protocol

New671 ...

func New685 added in v0.0.4

func New685(dragonflyMapping bool) *Protocol

New685 uses same data as 686

func New686 added in v0.0.4

func New686(dragonflyMapping bool) *Protocol

func New712 added in v0.0.3

func New712(dragonflyMapping bool) *Protocol

func New729 added in v0.0.3

func New729(dragonflyMapping bool) *Protocol

func New748

func New748(dragonflyMapping bool) *Protocol

func New766 added in v1.1.0

func New766(dragonflyMapping bool) *Protocol

func New776 added in v1.2.0

func New776(dragonflyMapping bool) *Protocol

func New786 added in v1.4.0

func New786(dragonflyMapping bool) *Protocol

func New800 added in v1.5.0

func New800(dragonflyMapping bool) *Protocol

func New818 added in v1.6.0

func New818(dragonflyMapping bool) *Protocol

func New819 added in v1.6.0

func New819(dragonflyMapping bool) *Protocol

func (*Protocol) ConvertFromLatest

func (p *Protocol) ConvertFromLatest(pk packet.Packet, conn *minecraft.Conn) []packet.Packet

func (*Protocol) ConvertToLatest

func (p *Protocol) ConvertToLatest(pk packet.Packet, conn *minecraft.Conn) []packet.Packet

func (*Protocol) ID

func (p *Protocol) ID() int32

func (*Protocol) NewReader

func (p *Protocol) NewReader(r minecraft.ByteReader, shieldID int32, enableLimits bool) protocol.IO

func (*Protocol) NewWriter

func (p *Protocol) NewWriter(w minecraft.ByteWriter, shieldID int32) protocol.IO

func (*Protocol) Packets

func (p *Protocol) Packets(listener bool) packet.Pool

func (*Protocol) Ver

func (p *Protocol) Ver() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL