summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-08-08 09:12:22 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-08-08 09:12:22 +0200
commit61e858a3d2a61a4a96b7bb94a19c4e310774513c (patch)
tree16e7bff71d9f3e58bd44c5b2cf3cac2a2d92e723 /src
parentAdded to HUD id of selected block (diff)
downloadAltCraft-61e858a3d2a61a4a96b7bb94a19c4e310774513c.tar
AltCraft-61e858a3d2a61a4a96b7bb94a19c4e310774513c.tar.gz
AltCraft-61e858a3d2a61a4a96b7bb94a19c4e310774513c.tar.bz2
AltCraft-61e858a3d2a61a4a96b7bb94a19c4e310774513c.tar.lz
AltCraft-61e858a3d2a61a4a96b7bb94a19c4e310774513c.tar.xz
AltCraft-61e858a3d2a61a4a96b7bb94a19c4e310774513c.tar.zst
AltCraft-61e858a3d2a61a4a96b7bb94a19c4e310774513c.zip
Diffstat (limited to '')
-rw-r--r--src/Block.cpp129
1 files changed, 128 insertions, 1 deletions
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<std::string, std::string> TransformBlockIdToBlockStateName(BlockId blo
std::pair<std::string,std::string>("andesite", "normal"),
std::pair<std::string,std::string>("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<std::string, std::string> ids[] = {
+ std::pair<std::string,std::string>("dirt", "normal"),
+ std::pair<std::string,std::string>("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<std::string, std::string> ids[] = {
+ std::pair<std::string,std::string>("oak_planks", "normal"),
+ std::pair<std::string,std::string>("spruce_planks", "normal"),
+ std::pair<std::string,std::string>("birch_panks", "normal"),
+ std::pair<std::string,std::string>("jungle_planks", "normal"),
+ std::pair<std::string,std::string>("acacia_planks", "normal"),
+ std::pair<std::string,std::string>("dark_oak_panks", "normal"),
+ };
+ return ids[blockId.state];
+ }
+ case 12: {
+ if (blockId.state > 1)
+ break;
+ static const std::pair<std::string, std::string> ids[] = {
+ std::pair<std::string,std::string>("sand", "normal"),
+ std::pair<std::string,std::string>("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<std::string, std::string> ids[] = {
+ std::pair<std::string,std::string>("oak_leaves", "normal"),
+ std::pair<std::string,std::string>("spruce_leaves", "normal"),
+ std::pair<std::string,std::string>("birch_leaves", "normal"),
+ std::pair<std::string,std::string>("jungle_leaves", "normal"),
+ };
+ return ids[blockId.state & 0x3];
+ }
+ case 31: {
+ if (blockId.state > 2)
+ break;
+ static const std::pair<std::string, std::string> ids[] = {
+ std::pair<std::string,std::string>("dead_bush", "normal"),
+ std::pair<std::string,std::string>("tall_grass", "normal"),
+ std::pair<std::string,std::string>("fern", "normal"),
+ };
+ return ids[blockId.state];
+ }
+ case 35: {
+ static const std::pair<std::string, std::string> ids[] = {
+ std::pair<std::string,std::string>("white_wool", "normal"),
+ std::pair<std::string,std::string>("orange_wool", "normal"),
+ std::pair<std::string,std::string>("magenta_wool", "normal"),
+ std::pair<std::string,std::string>("light_blue_wool", "normal"),
+ std::pair<std::string,std::string>("yellow_wool", "normal"),
+ std::pair<std::string,std::string>("lime_wool", "normal"),
+ std::pair<std::string,std::string>("pink_wool", "normal"),
+ std::pair<std::string,std::string>("gray_wool", "normal"),
+ std::pair<std::string,std::string>("light_gray_wool", "normal"),
+ std::pair<std::string,std::string>("cyan_wool", "normal"),
+ std::pair<std::string,std::string>("purple_wool", "normal"),
+ std::pair<std::string,std::string>("blue_wool", "normal"),
+ std::pair<std::string,std::string>("green_wool", "normal"),
+ std::pair<std::string,std::string>("red_wool", "normal"),
+ std::pair<std::string,std::string>("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<std::string, std::string> ids[] = {
+ std::pair<std::string,std::string>("poppy", "normal"),
+ std::pair<std::string,std::string>("blue_orchid", "normal"),
+ std::pair<std::string,std::string>("allium", "normal"),
+ std::pair<std::string,std::string>("Azure Bluet", "normal"),
+ std::pair<std::string,std::string>("red_tulip", "normal"),
+ std::pair<std::string,std::string>("orange_tulip", "normal"),
+ std::pair<std::string,std::string>("white_tulip", "normal"),
+ std::pair<std::string,std::string>("pink_tulip", "normal"),
+ std::pair<std::string,std::string>("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;
}