From 3f7aca1ad56db6e3ae41dbc8c4c74bf1af50bff4 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Wed, 22 Aug 2018 01:04:13 +0500 Subject: Added BlockStates --- src/Block.cpp | 153 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 149 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Block.cpp b/src/Block.cpp index 3de1901..2ef79e9 100644 --- a/src/Block.cpp +++ b/src/Block.cpp @@ -20,11 +20,12 @@ std::pair TransformBlockIdToBlockStateName(BlockId blo return std::make_pair("grass", "snowy=false"); } case 3: { - if (blockId.state > 1) + if (blockId.state > 2) break; static const std::pair ids[] = { std::pair("dirt", "normal"), std::pair("coarse_dirt", "normal"), + std::pair("podzol", "snowy=false"), }; return ids[blockId.state]; } @@ -37,13 +38,16 @@ std::pair TransformBlockIdToBlockStateName(BlockId blo static const std::pair ids[] = { std::pair("oak_planks", "normal"), std::pair("spruce_planks", "normal"), - std::pair("birch_panks", "normal"), + std::pair("birch_planks", "normal"), std::pair("jungle_planks", "normal"), std::pair("acacia_planks", "normal"), - std::pair("dark_oak_panks", "normal"), + std::pair("dark_oak_planks", "normal"), }; return ids[blockId.state]; } + case 7: { + return std::make_pair("bedrock", "normal"); + } case 8: case 9: { return std::make_pair("water", "normal"); @@ -105,6 +109,22 @@ std::pair TransformBlockIdToBlockStateName(BlockId blo case 21: { return std::make_pair("lapis_ore", "normal"); } + case 22: { + return std::make_pair("lapis_block", "normal"); + } + case 24: { + if (blockId.state > 2) + break; + static const std::pair ids[] = { + std::pair("sandstone", "normal"), + std::pair("chiseled_sandstone", "normal"), + std::pair("smooth_sandstone", "normal"), + }; + return ids[blockId.state]; + } + case 30: { + return std::make_pair("web", "normal"); + } case 31: { if (blockId.state > 2) break; @@ -115,6 +135,9 @@ std::pair TransformBlockIdToBlockStateName(BlockId blo }; return ids[blockId.state]; } + case 32: { + return std::make_pair("dead_bush", "normal"); + } case 35: { static const std::pair ids[] = { std::pair("white_wool", "normal"), @@ -125,7 +148,7 @@ std::pair TransformBlockIdToBlockStateName(BlockId blo std::pair("lime_wool", "normal"), std::pair("pink_wool", "normal"), std::pair("gray_wool", "normal"), - std::pair("light_gray_wool", "normal"), + std::pair("silver_wool", "normal"), std::pair("cyan_wool", "normal"), std::pair("purple_wool", "normal"), std::pair("blue_wool", "normal"), @@ -158,12 +181,24 @@ std::pair TransformBlockIdToBlockStateName(BlockId blo case 39: { return std::make_pair("brown_mushroom","normal"); } + case 40: { + return std::make_pair("red_mushroom", "normal"); + } + case 41: { + return std::make_pair("gold_block", "normal"); + } case 44: { return std::make_pair("stone_slab", "half=" + std::string(!(blockId.state >> 3) ? "bottom" : "top")); } + case 45: { + return std::make_pair("brick_block", "normal"); + } case 46: { return std::make_pair("tnt", "normal"); } + case 47: { + return std::make_pair("bookshelf", "normal"); + } case 48: { return std::make_pair("mossy_cobblestone", "normal"); } @@ -195,6 +230,12 @@ std::pair TransformBlockIdToBlockStateName(BlockId blo return std::make_pair("oak_stairs", dirs[dir] + (isUp? "top" : "bottom") +",shape=straight"); } + case 56: { + return std::make_pair("diamond_ore", "normal"); + } + case 57: { + return std::make_pair("diamond_block", "normal"); + } case 59: { return std::make_pair("wheat", "age=" + std::to_string(blockId.state)); } @@ -259,6 +300,12 @@ std::pair TransformBlockIdToBlockStateName(BlockId blo return std::make_pair("lever", types[blockId.state & 0x7] + ",powered=" + (isActive ? "true" : "false")); } + case 73: { + return std::make_pair("redstone_ore", "normal"); + } + case 74: { + return std::make_pair("redstone_ore", "normal"); + } case 78: { if (blockId.state > 7) break; @@ -277,6 +324,15 @@ std::pair TransformBlockIdToBlockStateName(BlockId blo case 79: { return std::make_pair("ice", "normal"); } + case 80: { + return std::make_pair("snow", "normal"); + } + case 81: { + return std::make_pair("cactus", "normal"); + } + case 82: { + return std::make_pair("clay", "normal"); + } case 83: { return std::make_pair("reeds", "normal"); } @@ -291,6 +347,12 @@ std::pair TransformBlockIdToBlockStateName(BlockId blo }; return ids[blockId.state]; } + case 87: { + return std::make_pair("netherrack", "normal"); + } + case 88: { + return std::make_pair("soul_sand", "normal"); + } case 89: { return std::make_pair("glowstone", "normal"); } @@ -316,6 +378,45 @@ std::pair TransformBlockIdToBlockStateName(BlockId blo unsigned char delay = (blockId.state >> 2) + 1; return std::make_pair("powered_repeater", "delay=" + std::to_string(delay) + ",facing=" + dirs[dir] + ",locked=false"); } + case 99: { + static const std::string variants[] = { + "variant=all_inside", + "variant=north_west", + "variant=north", + "variant=north_east", + "variant=west", + "variant=center", + "variant=east", + "variant=south_west", + "variant=south", + "variant=south_east", + "variant=stem", + "variant=all_outside", + "variant=all_stem", + }; + return std::make_pair("brown_mushroom_block", variants[blockId.state]); + } + case 100: { + static const std::string variants[] = { + "variant=all_inside", + "variant=north_west", + "variant=north", + "variant=north_east", + "variant=west", + "variant=center", + "variant=east", + "variant=south_west", + "variant=south", + "variant=south_east", + "variant=stem", + "variant=all_outside", + "variant=all_stem", + }; + return std::make_pair("red_mushroom_block", variants[blockId.state]); + } + case 103: { + return std::make_pair("melon_block", "normal"); + } case 106: { static const std::string values[] = { "false", @@ -326,6 +427,18 @@ std::pair TransformBlockIdToBlockStateName(BlockId blo case 111: { return std::make_pair("waterlily", "normal"); } + case 112: { + return std::make_pair("nether_brick", "normal"); + } + case 121: { + return std::make_pair("end_stone", "normal"); + } + case 129: { + return std::make_pair("emerald_ore", "normal"); + } + case 133: { + return std::make_pair("emerald_block", "normal"); + } case 141: { return std::make_pair("carrots", "age=" + std::to_string(blockId.state)); } @@ -344,6 +457,38 @@ std::pair TransformBlockIdToBlockStateName(BlockId blo bool isPowered = blockId.state >> 3; return std::make_pair("unpowered_comparator", "facing=" + dirs[dir] + ",mode=" + (substractMode ? "subtract" : "compare") + ",powered=" + (isPowered ? "true" : "false")); } + case 153: { + return std::make_pair("quartz_ore", "normal"); + } + case 155: { + return std::make_pair("quartz_block", "normal"); + } + case 161: { + if ((blockId.state & 0x3) > 2) + break; + static const std::pair ids[] = { + std::pair("acacia_leaves", "normal"), + std::pair("dark_oak_leaves", "normal"), + }; + return ids[blockId.state & 0x3]; + } + case 162: { + unsigned char type = blockId.state & 0x3; + if (type > 2) + break; + unsigned char dir = (blockId.state & 0xC) >> 2; + static const std::string types[] = { + "acacia_log", + "dark_oak_log", + }; + static const std::string dirs[] = { + "axis=y", + "axis=x", + "axis=z", + "axis=none", + }; + return std::make_pair(types[type], dirs[dir]); + } case 175: { bool high = ((blockId.state >> 3) & 0x1); unsigned char type = blockId.state & 0x7; -- cgit v1.2.3