package server const playerHeight = 51 const blockSize = 32 type blockCoord int64 type entityCoord int64 type entityFacing struct { Yaw, Pitch uint8 } type blockPos struct { X, Y, Z blockCoord } type entityPos struct { X, Y, Z entityCoord } func fromFloat(f float64) entityCoord { return entityCoord(f * 32) } func entityToBlock(pos entityPos) blockPos { return blockPos { blockCoord(pos.X >> 5), blockCoord(pos.Y >> 5), blockCoord(pos.Z >> 5), } } func blockToEntity(pos blockPos) entityPos { return entityPos { entityCoord(pos.X << 5), entityCoord(pos.Y << 5), entityCoord(pos.Z << 5), } }