mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-05 17:44:52 +01:00
NBT: IntArray: allow accessing individual elements
This commit is contained in:
parent
73a072c2ca
commit
59e0ce1f0c
1 changed files with 5 additions and 1 deletions
|
@ -58,7 +58,7 @@ public:
|
||||||
std::string inner = indent + " ";
|
std::string inner = indent + " ";
|
||||||
|
|
||||||
for (size_t i = 0; i < len; i++) {
|
for (size_t i = 0; i < len; i++) {
|
||||||
uint32_t v = Buffer::parse32(&ptr[4*i]);
|
uint32_t v = getValue(i);
|
||||||
|
|
||||||
os << inner
|
os << inner
|
||||||
<< v << " / "
|
<< v << " / "
|
||||||
|
@ -77,6 +77,10 @@ public:
|
||||||
const uint8_t * getPointer() const {
|
const uint8_t * getPointer() const {
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t getValue(size_t i) const {
|
||||||
|
return Buffer::parse32(&ptr[4*i]);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue