We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d02bfd commit 681cbe8Copy full SHA for 681cbe8
1 file changed
src/coordinate.cpp
@@ -25,16 +25,13 @@ Coordinate Coordinate::operator-(const Coordinate& obj) const {
25
}
26
27
std::size_t Coordinate::operator()(const mcpp::Coordinate& obj) const {
28
- // Minecraft coordinate bounds
29
int lower = -3e7, upper = 3e7;
30
size_t base = upper - lower + 1;
31
32
- // Convert coordinate attributes to non-negative values
33
size_t nx = obj.x - lower;
34
size_t ny = obj.y - lower;
35
size_t nz = obj.z - lower;
36
37
- // Combine and weight coordinate values using the boundary range
38
return nx * base * base + ny * base + nz;
39
40
0 commit comments