summaryrefslogtreecommitdiffstats
path: root/src/MinedMap.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-02-01 03:21:57 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-02-01 03:21:57 +0100
commitfc1fc8fbbc9dd9534f40de348210ea66b6defe42 (patch)
tree3cfa5fae12050f49df5cc6bc0482d4e5a45711d1 /src/MinedMap.cpp
parenta6a2a6281218688de7a74a9cd2a426aad3fe2da2 (diff)
downloadMinedMap-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.cpp9
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;