https://github.com/df-mc/structure
Structure parsing and writing library for Dragonfly
https://github.com/df-mc/structure
df-mc go golang library mcpe minecraft structure
Last synced: 5 months ago
JSON representation
Structure parsing and writing library for Dragonfly
- Host: GitHub
- URL: https://github.com/df-mc/structure
- Owner: df-mc
- Created: 2020-07-28T09:39:36.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-22T12:58:20.000Z (almost 3 years ago)
- Last Synced: 2023-08-22T16:36:50.586Z (almost 3 years ago)
- Topics: df-mc, go, golang, library, mcpe, minecraft, structure
- Language: Go
- Homepage:
- Size: 159 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Structure
Structure is a library for Dragonfly implementing support for reading and writing Minecraft Bedrock Edition structures.
## Installation
Structure requires at least Go 1.18. The library may be installed using:
```shell
go get github.com/df-mc/structure
```
## Usage
Structures may be read (from a file) using the `structure.Read` and `structure.ReadFile` functions. These structures may
be edited and written afterwards using the `structure.Write` and `structure.WriteFile` functions. Alternatively, a new
structure can be created using `structure.New`.
An example of reading and building a structure in a world:
```go
package main
import (
"github.com/df-mc/dragonfly/server/world"
"github.com/df-mc/structure"
)
func main() {
s, err := structure.ReadFile("example.mcstructure")
if err != nil {
panic(err)
}
var w *world.World
w.BuildStructure(world.BlockPos{}, s)
}
```
## Documentation
[](https://pkg.go.dev/github.com/df-mc/structure)
## Contact
[](https://discord.gg/U4kFWHhTNR)