-v3s16 Database::getIntegerAsBlock(long long i) {
- s32 x = unsignedToSigned(pythonmodulo(i, 4096), 2048);
- i = (i - x) / 4096;
- s32 y = unsignedToSigned(pythonmodulo(i, 4096), 2048);
- i = (i - y) / 4096;
- s32 z = unsignedToSigned(pythonmodulo(i, 4096), 2048);
- return v3s16(x,y,z);
+
+v3s16 Database::getIntegerAsBlock(s64 i) const
+{
+ v3s16 pos;
+ pos.X = unsigned_to_signed(pythonmodulo(i, 4096), 2048);
+ i = (i - pos.X) / 4096;
+ pos.Y = unsigned_to_signed(pythonmodulo(i, 4096), 2048);
+ i = (i - pos.Y) / 4096;
+ pos.Z = unsigned_to_signed(pythonmodulo(i, 4096), 2048);
+ return pos;