add generator tag
This commit is contained in:
@ -16,6 +16,7 @@ type Block interface {
|
|||||||
|
|
||||||
// This file stores all possible block states into a TAG_List with gzip compressed.
|
// This file stores all possible block states into a TAG_List with gzip compressed.
|
||||||
//
|
//
|
||||||
|
//go:generate go run ./generator/blocks/main.go
|
||||||
//go:embed block_states.nbt
|
//go:embed block_states.nbt
|
||||||
var blockStates []byte
|
var blockStates []byte
|
||||||
|
|
||||||
|
@ -74,6 +74,7 @@ func genSourceFile(states []State) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
log.Print("Generated blocks.go")
|
||||||
}
|
}
|
||||||
|
|
||||||
var typeMaps = map[string]string{
|
var typeMaps = map[string]string{
|
||||||
|
@ -82,6 +82,7 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panic(err)
|
log.Panic(err)
|
||||||
}
|
}
|
||||||
|
log.Print("Generated properties_enum.go")
|
||||||
}
|
}
|
||||||
|
|
||||||
func UpperTheFirst(word string) string {
|
func UpperTheFirst(word string) string {
|
||||||
|
@ -2,6 +2,8 @@ package block
|
|||||||
|
|
||||||
import "strconv"
|
import "strconv"
|
||||||
|
|
||||||
|
//go:generate go run ./generator/properties/main.go
|
||||||
|
|
||||||
type Boolean bool
|
type Boolean bool
|
||||||
|
|
||||||
func (b Boolean) MarshalText() (text []byte, err error) {
|
func (b Boolean) MarshalText() (text []byte, err error) {
|
||||||
|
@ -62,15 +62,23 @@ func (d *MojangLoginHandler) AcceptLogin(conn *net.Conn, protocol int32) (name s
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var hasPubKey pk.Boolean
|
var (
|
||||||
var pubKey auth.PublicKey
|
hasPubKey pk.Boolean
|
||||||
|
pubKey auth.PublicKey
|
||||||
|
hasUUID pk.Boolean
|
||||||
|
profileUUID pk.UUID // ignored
|
||||||
|
)
|
||||||
err = p.Scan(
|
err = p.Scan(
|
||||||
(*pk.String)(&name),
|
(*pk.String)(&name), //decode username as pk.String
|
||||||
&hasPubKey, pk.Opt{
|
&hasPubKey, pk.Opt{
|
||||||
Has: &hasPubKey,
|
Has: &hasPubKey,
|
||||||
Field: &pubKey,
|
Field: &pubKey,
|
||||||
},
|
},
|
||||||
) //decode username as pk.String
|
&hasUUID, pk.Opt{
|
||||||
|
Has: &hasUUID,
|
||||||
|
Field: &profileUUID,
|
||||||
|
},
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user