diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-02-01 03:21:57 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-02-01 03:21:57 +0100 |
commit | fc1fc8fbbc9dd9534f40de348210ea66b6defe42 (patch) | |
tree | 3cfa5fae12050f49df5cc6bc0482d4e5a45711d1 /src/MinedMap.cpp | |
parent | a6a2a6281218688de7a74a9cd2a426aad3fe2da2 (diff) | |
download | MinedMap-fc1fc8fbbc9dd9534f40de348210ea66b6defe42.tar MinedMap-fc1fc8fbbc9dd9534f40de348210ea66b6defe42.zip |
Use template argument for list subtype, extract further information from chunks
Diffstat (limited to 'src/MinedMap.cpp')
-rw-r--r-- | src/MinedMap.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/MinedMap.cpp b/src/MinedMap.cpp index 97074b2..8759d9d 100644 --- a/src/MinedMap.cpp +++ b/src/MinedMap.cpp @@ -25,6 +25,7 @@ #include "World/Region.hpp" +#include "NBT/ListTag.hpp" #include <iostream> #include <unistd.h> @@ -42,8 +43,12 @@ int main(int argc, char *argv[]) { const World::Chunk &chunk = *region(0, 0); - for (auto &entry : std::dynamic_pointer_cast<const NBT::CompoundTag>(chunk->get("Level"))->getValues()) { - std::cout << entry.first << " " << entry.second->getType() << std::endl; + for (auto &entry : chunk.getSections()) { + std::cout << entry->getType() << ":" << std::endl; + + for (auto &entry2 : *entry) { + std::cout << entry2.first << " " << entry2.second->getType() << std::endl; + } } return 0; |