This commit is contained in:
adman
2026-01-25 12:55:27 +01:00
parent 0034a2c6d4
commit 85529b965b
7 changed files with 34 additions and 8 deletions
+13
View File
@@ -4,6 +4,8 @@ import (
"encoding/json"
"fmt"
"strings"
"github.com/admin-else/strom/nbt"
)
// Component represents a Minecraft text component.
@@ -538,3 +540,14 @@ func (c *Component) writePretty(sb *strings.Builder) {
extra.writePretty(sb)
}
}
func (c *Component) AsNBT() nbt.Anon {
return nbt.Anon{Value: c.ToNBT()}
}
func (c *Component) AsOldNBT() nbt.Tag {
return nbt.Tag{
Name: "",
Value: c.ToNBT(),
}
}