Documentation
¶
Index ¶
- type Block
- type DefaultBlockMapping
- func (m *DefaultBlockMapping) Adjust(entries []protocol.BlockEntry)
- func (m *DefaultBlockMapping) Air() uint32
- func (m *DefaultBlockMapping) DowngradeBlockActorData(actorData map[string]any)
- func (m *DefaultBlockMapping) RuntimeIDToState(runtimeId uint32) (blockupgrader.BlockState, bool)
- func (m *DefaultBlockMapping) StateToRuntimeID(state blockupgrader.BlockState) (uint32, bool)
- func (m *DefaultBlockMapping) UpgradeBlockActorData(actorData map[string]any)
- func (m *DefaultBlockMapping) WithBlockActorRemapper(downgrader, upgrader func(map[string]any) map[string]any) *DefaultBlockMapping
- type DefaultItemMapping
- func (m *DefaultItemMapping) Air() int32
- func (m *DefaultItemMapping) ItemNameToRuntimeID(name string) (runtimeID int32, found bool)
- func (m *DefaultItemMapping) ItemRuntimeIDToName(runtimeID int32) (name string, found bool)
- func (m *DefaultItemMapping) ItemVersion() uint16
- func (m *DefaultItemMapping) RegisterEntry(name string) int32
- func (m *DefaultItemMapping) RegisterEntryRID(name string, rid int32)
- type Item
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block interface { // StateToRuntimeID converts a block state to a runtime ID. StateToRuntimeID(blockupgrader.BlockState) (uint32, bool) // RuntimeIDToState converts a runtime ID to a name and its state properties. RuntimeIDToState(uint32) (blockupgrader.BlockState, bool) // DowngradeBlockActorData downgrades the input sub chunk to a legacy block actor. DowngradeBlockActorData(map[string]any) // UpgradeBlockActorData upgrades the input sub chunk to the latest block actor. UpgradeBlockActorData(map[string]any) // Adjust adjusts the latest mappings to account for custom states. Adjust([]protocol.BlockEntry) Air() uint32 }
type DefaultBlockMapping ¶
type DefaultBlockMapping struct {
// contains filtered or unexported fields
}
func NewBlockMapping ¶
func NewBlockMapping(raw []byte) *DefaultBlockMapping
func (*DefaultBlockMapping) Adjust ¶
func (m *DefaultBlockMapping) Adjust(entries []protocol.BlockEntry)
func (*DefaultBlockMapping) Air ¶
func (m *DefaultBlockMapping) Air() uint32
func (*DefaultBlockMapping) DowngradeBlockActorData ¶
func (m *DefaultBlockMapping) DowngradeBlockActorData(actorData map[string]any)
func (*DefaultBlockMapping) RuntimeIDToState ¶
func (m *DefaultBlockMapping) RuntimeIDToState(runtimeId uint32) (blockupgrader.BlockState, bool)
func (*DefaultBlockMapping) StateToRuntimeID ¶
func (m *DefaultBlockMapping) StateToRuntimeID(state blockupgrader.BlockState) (uint32, bool)
func (*DefaultBlockMapping) UpgradeBlockActorData ¶
func (m *DefaultBlockMapping) UpgradeBlockActorData(actorData map[string]any)
func (*DefaultBlockMapping) WithBlockActorRemapper ¶
func (m *DefaultBlockMapping) WithBlockActorRemapper(downgrader, upgrader func(map[string]any) map[string]any) *DefaultBlockMapping
type DefaultItemMapping ¶
type DefaultItemMapping struct {
// contains filtered or unexported fields
}
func NewItemMapping ¶
func NewItemMapping(itemRuntimeIDData []byte, requiredItemList []byte, itemVersion uint16, direct bool) *DefaultItemMapping
func (*DefaultItemMapping) Air ¶
func (m *DefaultItemMapping) Air() int32
func (*DefaultItemMapping) ItemNameToRuntimeID ¶
func (m *DefaultItemMapping) ItemNameToRuntimeID(name string) (runtimeID int32, found bool)
func (*DefaultItemMapping) ItemRuntimeIDToName ¶
func (m *DefaultItemMapping) ItemRuntimeIDToName(runtimeID int32) (name string, found bool)
func (*DefaultItemMapping) ItemVersion ¶
func (m *DefaultItemMapping) ItemVersion() uint16
func (*DefaultItemMapping) RegisterEntry ¶
func (m *DefaultItemMapping) RegisterEntry(name string) int32
func (*DefaultItemMapping) RegisterEntryRID ¶ added in v1.0.1
func (m *DefaultItemMapping) RegisterEntryRID(name string, rid int32)
type Item ¶
type Item interface { // ItemRuntimeIDToName converts an item runtime ID to a string ID. ItemRuntimeIDToName(int32) (string, bool) // ItemNameToRuntimeID converts a string ID to an item runtime ID. ItemNameToRuntimeID(string) (int32, bool) RegisterEntry(string) int32 RegisterEntryRID(string, int32) Air() int32 ItemVersion() uint16 }
Click to show internal directories.
Click to hide internal directories.