schematic

package
v0.0.0-...-dea517c Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ByID = map[string]Entity{
	"minecraft:glow_item_frame": GlowItemFrame{},
}

Functions

func SetDefaultAuthor

func SetDefaultAuthor(s string)

func SetDefaultDescription

func SetDefaultDescription(s string)

func SetDefaultMinecraftDataVersion

func SetDefaultMinecraftDataVersion(v int)

func SetDefaultVersion

func SetDefaultVersion(v int)

Types

type BitArray

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

func NewBitArray

func NewBitArray(bits, EntrySize int, data []int64) *BitArray

func NewEmptyBitArray

func NewEmptyBitArray(EntrySize int) *BitArray

func (*BitArray) BitsPerEntry

func (b *BitArray) BitsPerEntry() int

type BlockState

type BlockState struct {
	Name       string
	Properties block.Block `nbt_omitempty:"true"`
}

func NewBlockState

func NewBlockState(b block.Block) BlockState

type Blocks

type Blocks struct {
	Pos   []int32 `nbt:"pos" nbt_type:"list"`
	State int32   `nbt:"state"`
}

type CompoundTag

type CompoundTag struct {
	Name string
}

type Entity

type Entity interface {
	ID() string
}

type FrameItem

type FrameItem struct {
	Count int32
	ID    string `nbt:"id"`
	Tag   Tag    `nbt:"tag"`
}

type GlowItemFrame

type GlowItemFrame struct {
	Air            int16
	Facing         uint8
	FallDistance   float32
	Fire           int16
	Fixed          uint8
	Invisible      uint8
	Invulnerable   uint8
	Item           FrameItem `nbt_omitempty:"true"`
	ItemDropChance float32   `nbt_omitempty:"true"`
	ItemRotation   uint8     `nbt_omitempty:"true"`
	Motion         []float64 `nbt_type:"list"`
	OnGround       uint8
	PortalCooldown int32
	Pos            []float64 `nbt_type:"list"`
	Rotation       []float32 `nbt_type:"list"`
	TileX          int32
	TileY          int32
	TileZ          int32
	UUID           []int32 `nbt_type:"list"`
	Id             string  `nbt:"id"`
}

func (GlowItemFrame) ID

func (e GlowItemFrame) ID() string

type ID

type ID struct {
	ID string `nbt:"id"`
}

type Litematic

type Litematic struct {
	Metadata             Metadata
	MinecraftDataVersion int32
	Version              int32
	Regions              map[string]Region
}

func ReadLitematicaFile

func ReadLitematicaFile(r io.Reader) (*Litematic, error)

func (*Litematic) Encode

func (l *Litematic) Encode(w io.Writer) error

func (*Litematic) GetRegion

func (l *Litematic) GetRegion() (Region, string, error)

type LitematicWithRawMessage

type LitematicWithRawMessage struct {
	Metadata             Metadata
	MinecraftDataVersion int32
	Version              int32
	Regions              map[string]RegionWithRawMessage
}

type Metadata

type Metadata struct {
	Author        string
	Description   string
	EnclosingSize Vec3D
	Name          string
	RegionCount   int32
	TimeCreated   int64
	TimeModified  int64
	TotalBlocks   int32
	TotalVolume   int32
}

type Nbt

type Nbt struct {
	Blocks      []Blocks     `nbt:"blocks"`
	Entities    []Entity     `nbt:"entities"`
	Palette     []BlockState `nbt:"palette"`
	Size        []int32      `nbt:"size" nbt_type:"list"`
	Author      string       `nbt:"author"`
	DataVersion int32
}

func ReadNbtFile

func ReadNbtFile(r io.Reader) (*Nbt, error)

func (*Nbt) Encode

func (n *Nbt) Encode(w io.Writer) error

type NbtWithRawMessage

type NbtWithRawMessage struct {
	Blocks      []Blocks         `nbt:"blocks"`
	Entities    []nbt.RawMessage `nbt:"entities"`
	Palette     []state          `nbt:"palette"`
	Size        []int32          `nbt:"size" nbt_type:"list"`
	Author      string           `nbt:"author"`
	DataVersion int32
}

type Project

type Project struct {
	MetaData Metadata

	MinecraftDataVersion int32

	Version int32

	//Region's key
	RegionName string
	// contains filtered or unexported fields
}

func LoadFromFile

func LoadFromFile(file *os.File) (*Project, error)

func LoadFromLitematic

func LoadFromLitematic(f io.Reader) (*Project, error)

func LoadFromNbt

func LoadFromNbt(name string, f io.Reader) (*Project, error)

func NewProject

func NewProject(name string, x, y, z int) *Project

func (*Project) AddEntity

func (p *Project) AddEntity(e Entity)

func (*Project) ChangeMaterial

func (p *Project) ChangeMaterial(from, to block.Block)

func (*Project) Contain

func (p *Project) Contain(block BlockState) bool

func (*Project) Data

func (p *Project) Data() []int64

func (*Project) Encode

func (p *Project) Encode(w io.Writer) error

Encode default encode litematic file

func (*Project) GetBlock

func (p *Project) GetBlock(x, y, z int) BlockState

func (*Project) Litematic

func (p *Project) Litematic() *Litematic

func (*Project) Nbt

func (p *Project) Nbt() *Nbt

func (*Project) Palette

func (p *Project) Palette() []BlockState

func (*Project) SetBlock

func (p *Project) SetBlock(x, y, z int, b block.Block)

func (*Project) Size

func (p *Project) Size() Vec3D

func (*Project) XRange

func (p *Project) XRange() int

func (*Project) YRange

func (p *Project) YRange() int

func (*Project) ZRange

func (p *Project) ZRange() int

type Region

type Region struct {
	BlockStatePalette []BlockState
	TileEntities      []CompoundTag
	Entities          []Entity
	Position          Vec3D
	Size              Vec3D
	BlockStates       []int64
}

type RegionWithRawMessage

type RegionWithRawMessage struct {
	BlockStatePalette []state
	TileEntities      []CompoundTag
	Entities          []nbt.RawMessage
	Position          Vec3D
	Size              Vec3D
	BlockStates       []int64
}

type Tag

type Tag struct {
	Map int32 `nbt:"map"`
}

type Vec3D

type Vec3D struct {
	X int32 `nbt:"x"`
	Y int32 `nbt:"y"`
	Z int32 `nbt:"z"`
}

Jump to

Keyboard shortcuts

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