bst

package module
v0.0.0-...-9831451 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 8 Imported by: 0

README

vap

Structure format designed for storage of bedrock structures

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(b interface {
	io.Writer
	io.ByteWriter
}, v *Bst) error

Write writes the given Bst to the given byte buffer.

func WriteFile

func WriteFile(path string, v *Bst) error

WriteFile writes the given Bst to the given path.

Types

type Bst

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

Bst is a structure format is designed for small structures. It contains the actual structure information, along with the blocks inside the structure. It is very similar to the legacy schematic format.

func New

func New(name string, positions [3]mgl64.Vec3, bounds [3]uint32) *Bst

New creates a new Bst and initialises it with air blocks. The Bst returned may be written to using Bst.Set and read using Bst.At..

func Read

func Read(b interface {
	io.Reader
	io.ByteReader
}) (*Bst, error)

Read reads a Bst from the given byte reader.

func ReadFile

func ReadFile(path string) (*Bst, error)

ReadFile reads a Bst file from the given path.

func (*Bst) At

func (v *Bst) At(x, y, z int, _ func(x int, y int, z int) world.Block) (world.Block, world.Liquid)

At returns the block at the x, y and z passed in the structure.

func (*Bst) Dimensions

func (v *Bst) Dimensions() [3]int

Dimensions returns the bounds of the Bst.

func (*Bst) Name

func (v *Bst) Name() string

Name returns the name of the Bst.

func (*Bst) Set

func (v *Bst) Set(x, y, z int, b world.Block)

Set sets the block at a specific position within the Bst to the world.Block passed. Set will panic if the x, y or z exceed the bounds of the structure.

Jump to

Keyboard shortcuts

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