Fix server for 1.19.4

This commit is contained in:
Tnze
2023-04-05 18:06:29 +08:00
parent a9ab97292d
commit 195945e4ca
4 changed files with 44 additions and 47 deletions

View File

@ -410,20 +410,9 @@ func (p *Position) ReadFrom(r io.Reader) (n int64, err error) {
n += nn
x := int(v >> 38)
y := int(v & 0xFFF)
y := int(v << 52 >> 52)
z := int(v << 26 >> 38)
// 处理负数
if x >= 1<<25 {
x -= 1 << 26
}
if y >= 1<<11 {
y -= 1 << 12
}
if z >= 1<<25 {
z -= 1 << 26
}
p.X, p.Y, p.Z = x, y, z
return
}
@ -486,7 +475,7 @@ func NBT(v interface{}, optionalTagName ...string) Field {
}
type nbtField struct {
V interface{}
V any
FieldName string
}