feat: Added support for a chunk's pos to be used as a key
This commit is contained in:
parent
3cc759ce4b
commit
19bbf5beff
@ -35,6 +35,10 @@ type ChunkPos struct {
|
|||||||
Z int `json:"z"`
|
Z int `json:"z"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (cp ChunkPos) MarshalText() ([]byte, error) {
|
||||||
|
return []byte(fmt.Sprintf("%d %d", cp.Z, cp.Z)), nil
|
||||||
|
}
|
||||||
|
|
||||||
func (cp ChunkPos) ToFileName() string {
|
func (cp ChunkPos) ToFileName() string {
|
||||||
return fmt.Sprintf("p.%d.%d.chunk", cp.X, cp.Z)
|
return fmt.Sprintf("p.%d.%d.chunk", cp.X, cp.Z)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user