diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2018-07-24 01:33:21 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2018-07-24 19:26:40 +0200 |
commit | dd432af298e0bcaf165ac826613723f1dce4b10d (patch) | |
tree | e70207e996731a5b4a46a2d2903ede07b19bba73 /src/Resource/BlockType.hpp | |
parent | fed9c21f5ef44496d20b788035119860e76505f8 (diff) | |
download | MinedMap-dd432af298e0bcaf165ac826613723f1dce4b10d.tar MinedMap-dd432af298e0bcaf165ac826613723f1dce4b10d.zip |
Resolve pre-1.13 block types by mapping them to 1.13 types
Diffstat (limited to 'src/Resource/BlockType.hpp')
-rw-r--r-- | src/Resource/BlockType.hpp | 20 |
1 files changed, 18 insertions, 2 deletions
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 <cstdint> +#include <string> +#include <unordered_map> namespace MinedMap { namespace Resource { struct BlockType { +private: + static const std::unordered_map<std::string, BlockType> 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; } } |