NBT: unify API of different array types

This commit is contained in:
Matthias Schiffer 2019-12-11 21:02:51 +01:00
parent c313db2994
commit 466f393d26
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
4 changed files with 17 additions and 9 deletions

View file

@ -58,7 +58,7 @@ private:
uint8_t getBiomeAt(size_t x, size_t z) const {
if (biomeBytes)
return biomeBytes->getValue()[z*SIZE + x];
return biomeBytes->getValue(z*SIZE + x);
else
return biomeInts->getValue(z*SIZE + x);
}

View file

@ -78,7 +78,7 @@ public:
if (!blockLight)
return 0;
return getHalf(blockLight->getValue(), x, y, z);
return getHalf(blockLight->getPointer(), x, y, z);
}
static std::unique_ptr<Section> makeSection(const std::shared_ptr<const NBT::CompoundTag> &section, uint32_t dataVersion);
@ -91,11 +91,11 @@ private:
uint8_t getBlockAt(size_t x, size_t y, size_t z) const {
return blocks->getValue()[getIndex(x, y, z)];
return blocks->getValue(getIndex(x, y, z));
}
uint8_t getDataAt(size_t x, size_t y, size_t z) const {
return getHalf(data->getValue(), x, y, z);
return getHalf(data->getPointer(), x, y, z);
}
public: