legacyver

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

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 = 231
	// BlockVersion766 ...
	BlockVersion766 int32 = (1 << 24) | (21 << 16) | (50 << 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(latestBlockMapping, BlockVersionLatest)
	// LatestBlockPaletteEncoding is the paletteEncoding used for encoding a palette of block states encoded as NBT.
	LatestBlockPaletteEncoding = chunk.NewBlockPaletteEncoding(latestBlockMapping, BlockVersionLatest)
)

Functions

This section is empty.

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) 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) 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) 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

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
}

type Protocol

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

func New685 added in v0.0.4

func New685(direct bool) *Protocol

New685 uses same data as 686

func New686 added in v0.0.4

func New686(direct bool) *Protocol

func New712 added in v0.0.3

func New712(direct bool) *Protocol

func New729 added in v0.0.3

func New729(direct bool) *Protocol

func New748

func New748(direct 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