From dd432af298e0bcaf165ac826613723f1dce4b10d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 24 Jul 2018 01:33:21 +0200 Subject: Resolve pre-1.13 block types by mapping them to 1.13 types --- src/Resource/BlockType.hpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/Resource/BlockType.hpp') diff --git a/src/Resource/BlockType.hpp b/src/Resource/BlockType.hpp index 755719d..e0946f6 100644 --- a/src/Resource/BlockType.hpp +++ b/src/Resource/BlockType.hpp @@ -27,17 +27,33 @@ #pragma once #include +#include +#include namespace MinedMap { namespace Resource { struct BlockType { +private: + static const std::unordered_map Types; + +public: + static const BlockType * lookup(const std::string &name); + bool opaque; bool green; - uint32_t color; + bool blue; + struct { + uint8_t r, g, b; + } color; +}; + + +struct LegacyPalette { + const BlockType *types[256][16]; }; -extern const BlockType BLOCK_TYPES[256][16]; +extern const LegacyPalette LEGACY_BLOCK_TYPES; } } -- cgit v1.2.3