format repo with "gofumpt" tool

This commit is contained in:
Tnze
2022-11-26 20:37:57 +08:00
parent 7814e7b1ab
commit fad92fe364
61 changed files with 333 additions and 268 deletions

View File

@ -20,18 +20,22 @@ type Block interface {
//go:embed block_states.nbt
var blockStates []byte
var ToStateID map[Block]StateID
var StateList []Block
var (
ToStateID map[Block]StateID
StateList []Block
)
// BitsPerBlock indicates how many bits are needed to represent all possible
// block states. This value is used to determine the size of the global palette.
var BitsPerBlock int
type StateID int
type State struct {
Name string
Properties nbt.RawMessage
}
type (
StateID int
State struct {
Name string
Properties nbt.RawMessage
}
)
func init() {
var states []State

View File

@ -70,7 +70,7 @@ func genSourceFile(states []State) {
panic(err)
}
err = os.WriteFile("blocks.go", formattedSource, 0666)
err = os.WriteFile("blocks.go", formattedSource, 0o666)
if err != nil {
panic(err)
}

View File

@ -78,7 +78,7 @@ func main() {
if err != nil {
log.Panic(err)
}
err = os.WriteFile("properties_enum.go", formattedSource, 0666)
err = os.WriteFile("properties_enum.go", formattedSource, 0o666)
if err != nil {
log.Panic(err)
}