world

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type World

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

World holds the LevelDB instance, wraps its functions and provides functions for any other World needs

func OpenWorld

func OpenWorld(path string) (World, error)

OpenWorld opens a Minecraft Pocket Edition world folder

func (*World) Close

func (world *World) Close() error

Close needs to be called before exiting to relase the LevelDB locks

func (*World) Delete

func (world *World) Delete(key []byte) error

Delete deletes a key and its value from the world database

func (*World) FilePath

func (world *World) FilePath() string

FilePath returns the path used to open the world

func (*World) Get

func (world *World) Get(key []byte) ([]byte, error)

Get gets a value from the world database

func (*World) GetKeys

func (world *World) GetKeys() ([][]byte, error)

GetKeys returns all keys in the LevelDB database

func (*World) GetLevelDat added in v0.3.0

func (world *World) GetLevelDat() ([]byte, error)

GetLevelDat gets a the contents of level.dat

func (*World) GetLevelDatNbtAndVersion added in v0.3.0

func (world *World) GetLevelDatNbtAndVersion() ([]byte, int32, error)

GetLevelDatNbtAndVersion returns the version and nbt portions of level.dat

func (*World) Put

func (world *World) Put(key []byte, value []byte) error

Put puts a key/value pair into the world database, superceding/replacing/deleting the existing value for that key, if any

func (*World) PutLevelDat added in v0.3.0

func (world *World) PutLevelDat(levelDatData []byte) error

PutLevelDat replaces the contents of level.dat

func (*World) PutLevelDatNbtAndVersion added in v0.3.0

func (world *World) PutLevelDatNbtAndVersion(levelDatData []byte, version int32) error

PutLevelDatNbtAndVersion builds the header info for level.dat given the nbt and version, and then replaces level.dat

Jump to

Keyboard shortcuts

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