translator

package
v0.0.0-...-48500b4 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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
}

Jump to

Keyboard shortcuts

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