From 61e858a3d2a61a4a96b7bb94a19c4e310774513c Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Wed, 8 Aug 2018 12:12:22 +0500 Subject: Added more BlockStates --- src/Block.cpp | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 128 insertions(+), 1 deletion(-) diff --git a/src/Block.cpp b/src/Block.cpp index 98f1b0a..41199de 100644 --- a/src/Block.cpp +++ b/src/Block.cpp @@ -34,12 +34,139 @@ std::pair TransformBlockIdToBlockStateName(BlockId blo std::pair("andesite", "normal"), std::pair("smooth_andesite", "normal"), }; - return ids[blockId.state]; + return ids[blockId.state]; } case 2: { return std::make_pair("grass", "snowy=false"); } + case 3: { + if (blockId.state > 1) + break; + static const std::pair ids[] = { + std::pair("dirt", "normal"), + std::pair("coarse_dirt", "normal"), + }; + return ids[blockId.state]; + } + case 4: { + return std::make_pair("cobblestone", "normal"); + } + case 5: { + if (blockId.state > 5) + break; + static const std::pair ids[] = { + std::pair("oak_planks", "normal"), + std::pair("spruce_planks", "normal"), + std::pair("birch_panks", "normal"), + std::pair("jungle_planks", "normal"), + std::pair("acacia_planks", "normal"), + std::pair("dark_oak_panks", "normal"), + }; + return ids[blockId.state]; + } + case 12: { + if (blockId.state > 1) + break; + static const std::pair ids[] = { + std::pair("sand", "normal"), + std::pair("red_sand", "normal"), + }; + return ids[blockId.state]; + } + case 17: { + unsigned char type = blockId.state & 0x3; + unsigned char dir = (blockId.state & 0xC) >> 2; + static const std::string types[] = { + "oak_log", + "spruce_log", + "birch_log", + "jungle_log", + }; + static const std::string dirs[] = { + "axis=y", + "axis=x", + "axis=z", + "axis=none", + }; + return std::make_pair(types[type], dirs[dir]); + } + case 18: { + static const std::pair ids[] = { + std::pair("oak_leaves", "normal"), + std::pair("spruce_leaves", "normal"), + std::pair("birch_leaves", "normal"), + std::pair("jungle_leaves", "normal"), + }; + return ids[blockId.state & 0x3]; + } + case 31: { + if (blockId.state > 2) + break; + static const std::pair ids[] = { + std::pair("dead_bush", "normal"), + std::pair("tall_grass", "normal"), + std::pair("fern", "normal"), + }; + return ids[blockId.state]; + } + case 35: { + static const std::pair ids[] = { + std::pair("white_wool", "normal"), + std::pair("orange_wool", "normal"), + std::pair("magenta_wool", "normal"), + std::pair("light_blue_wool", "normal"), + std::pair("yellow_wool", "normal"), + std::pair("lime_wool", "normal"), + std::pair("pink_wool", "normal"), + std::pair("gray_wool", "normal"), + std::pair("light_gray_wool", "normal"), + std::pair("cyan_wool", "normal"), + std::pair("purple_wool", "normal"), + std::pair("blue_wool", "normal"), + std::pair("green_wool", "normal"), + std::pair("red_wool", "normal"), + std::pair("black_wool", "normal"), + }; + return ids[blockId.state]; + } + case 37: { + return std::make_pair("dandelion", "normal"); + } + case 38: { + if (blockId.state > 8) + break; + static const std::pair ids[] = { + std::pair("poppy", "normal"), + std::pair("blue_orchid", "normal"), + std::pair("allium", "normal"), + std::pair("Azure Bluet", "normal"), + std::pair("red_tulip", "normal"), + std::pair("orange_tulip", "normal"), + std::pair("white_tulip", "normal"), + std::pair("pink_tulip", "normal"), + std::pair("oxeye_daisy", "normal"), + }; + return ids[blockId.state]; + } + case 175: { + bool high = ((blockId.state >> 3) & 0x1); + unsigned char type = blockId.state & 0x7; + static const std::string types[] = { + "sunflower", + "Lilac", + "double_grass", + "double_fern", + "double_rose", + "Peony", + }; + + static const std::string isHigh[] = { + "half=lower", + "half=upper", + }; + return std::make_pair(types[type], isHigh[high]); + } default: break; } -- cgit v1.2.3