fix: Fixed the index lookups for non-zero chunk locations
This commit is contained in:
parent
9aa5e65c6c
commit
cd06c19473
@ -20,9 +20,9 @@ func (cd *ChunkData) IndexToBlockPos(index int) BlockPos {
|
|||||||
posZ := ((index - posX) % 256) / 16
|
posZ := ((index - posX) % 256) / 16
|
||||||
posY := ((index - posZ) % 4096) / 256
|
posY := ((index - posZ) % 4096) / 256
|
||||||
return BlockPos{
|
return BlockPos{
|
||||||
X: posX + cd.Pos.X,
|
X: posX + (cd.Pos.X * 16),
|
||||||
Y: uint(posY),
|
Y: uint(posY),
|
||||||
Z: posZ + cd.Pos.Z,
|
Z: posZ + (cd.Pos.Z * 16),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user