A Minecraft datapack generator written in go.
1package function
2
3import (
4 "strings"
5 "tangled.org/cosmeak.tngl.sh/weave/internal/generator"
6)
7
8func (f Function) Emit()(generator.File, error) {
9 content := strings.Join(f.commands, "\n")
10 return generator.File{
11 Path: "data/%namespace%/function/" + f.name + ".mcfunction",
12 Content: []byte(content),
13 }, nil
14}