From fc1fc8fbbc9dd9534f40de348210ea66b6defe42 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 1 Feb 2015 03:21:57 +0100 Subject: Use template argument for list subtype, extract further information from chunks --- src/MinedMap.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/MinedMap.cpp') 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 #include @@ -42,8 +43,12 @@ int main(int argc, char *argv[]) { const World::Chunk &chunk = *region(0, 0); - for (auto &entry : std::dynamic_pointer_cast(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; -- cgit v1.2.3