修复了mcadump生成的mca文件名坐标错误的问题
This commit is contained in:
@ -101,7 +101,7 @@ func pack(f, o string) {
|
|||||||
checkerr(fmt.Errorf("cannot use %s as mca file name: %v", rn, err))
|
checkerr(fmt.Errorf("cannot use %s as mca file name: %v", rn, err))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn := fmt.Sprintf("r.%d.%d.mca", x/32, z/32)
|
fn := fmt.Sprintf("r.%d.%d.mca", x>>5, z>>5)
|
||||||
r, err := region.Open(fn)
|
r, err := region.Open(fn)
|
||||||
if err != nil && os.IsNotExist(err) {
|
if err != nil && os.IsNotExist(err) {
|
||||||
r, err = region.Create(filepath.Join(o, fn))
|
r, err = region.Create(filepath.Join(o, fn))
|
||||||
|
1
go.sum
1
go.sum
@ -4,4 +4,5 @@ github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx
|
|||||||
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||||
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=
|
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=
|
||||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||||
|
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8=
|
||||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
Reference in New Issue
Block a user