From 37fbb814cb277fe5ce53240a3d02aa996000be1d Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Mon, 20 May 2019 14:06:25 +0500 Subject: Completely removed hardcoded list of blockstates --- cwd/assets/altcraft/scripts/blocks.lua | 491 ++++++++++++++++++++++++++++++ src/Block.cpp | 524 --------------------------------- src/Block.hpp | 3 - src/Render.cpp | 4 +- 4 files changed, 493 insertions(+), 529 deletions(-) diff --git a/cwd/assets/altcraft/scripts/blocks.lua b/cwd/assets/altcraft/scripts/blocks.lua index 07a1f77..325a8fc 100644 --- a/cwd/assets/altcraft/scripts/blocks.lua +++ b/cwd/assets/altcraft/scripts/blocks.lua @@ -9,9 +9,500 @@ end local function RegisterBlocks() AC.RegisterBlock(BlockId.new(1,0), true, "stone", "normal") + AC.RegisterBlock(BlockId.new(1,1), true, "granite", "normal") + AC.RegisterBlock(BlockId.new(1,2), true, "smooth_granite", "normal") + AC.RegisterBlock(BlockId.new(1,3), true, "diorite", "normal") + AC.RegisterBlock(BlockId.new(1,4), true, "smooth_diorite", "normal") + AC.RegisterBlock(BlockId.new(1,5), true, "andesite", "normal") + AC.RegisterBlock(BlockId.new(1,6), true, "smooth_andesite", "normal") + AC.RegisterBlock(BlockId.new(2,0), true, "grass", "snowy=false") + AC.RegisterBlock(BlockId.new(3,0), true, "dirt", "normal") + AC.RegisterBlock(BlockId.new(3,1), true, "coarse_dirt", "normal") + AC.RegisterBlock(BlockId.new(3,2), true, "podzol", "snowy=false") + + AC.RegisterBlock(BlockId.new(4,0), true, "cobblestone", "normal") + + AC.RegisterBlock(BlockId.new(5,0), true, "oak_planks", "normal") + AC.RegisterBlock(BlockId.new(5,1), true, "spruce_planks", "normal") + AC.RegisterBlock(BlockId.new(5,2), true, "birch_planks", "normal") + AC.RegisterBlock(BlockId.new(5,3), true, "jungle_planks", "normal") + AC.RegisterBlock(BlockId.new(5,4), true, "acacia_planks", "normal") + AC.RegisterBlock(BlockId.new(5,5), true, "dark_oak_planks", "normal") + + AC.RegisterBlock(BlockId.new(7,0), true, "bedrock", "normal") + + AC.RegisterBlock(BlockId.new(8,0), true, "water", "normal") + + AC.RegisterBlock(BlockId.new(9,0), true, "water", "normal") + + AC.RegisterBlock(BlockId.new(10,0), true, "lava", "normal") + + AC.RegisterBlock(BlockId.new(11,0), true, "lava", "normal") + + AC.RegisterBlock(BlockId.new(12,0), true, "sand", "normal") + AC.RegisterBlock(BlockId.new(12,1), true, "red_sand", "normal") + + AC.RegisterBlock(BlockId.new(13,0), true, "gravel", "normal") + + AC.RegisterBlock(BlockId.new(14,0), true, "gold_ore", "normal") + + AC.RegisterBlock(BlockId.new(15,0), true, "iron_ore", "normal") + + AC.RegisterBlock(BlockId.new(16,0), true, "coal_ore", "normal") + + AC.RegisterBlock(BlockId.new(17,0), true, "oak_log", "axis=y") + AC.RegisterBlock(BlockId.new(17,1), true, "spruce_log", "axis=y") + AC.RegisterBlock(BlockId.new(17,2), true, "birch_log", "axis=y") + AC.RegisterBlock(BlockId.new(17,3), true, "jungle_log", "axis=y") + AC.RegisterBlock(BlockId.new(17,4), true, "oak_log", "axis=x") + AC.RegisterBlock(BlockId.new(17,5), true, "spruce_log", "axis=x") + AC.RegisterBlock(BlockId.new(17,6), true, "birch_log", "axis=x") + AC.RegisterBlock(BlockId.new(17,7), true, "jungle_log", "axis=x") + AC.RegisterBlock(BlockId.new(17,8), true, "oak_log", "axis=z") + AC.RegisterBlock(BlockId.new(17,9), true, "spruce_log", "axis=z") + AC.RegisterBlock(BlockId.new(17,10), true, "birch_log", "axis=z") + AC.RegisterBlock(BlockId.new(17,11), true, "jungle_log", "axis=z") + AC.RegisterBlock(BlockId.new(17,12), true, "oak_log", "axis=none") + AC.RegisterBlock(BlockId.new(17,13), true, "spruce_log", "axis=none") + AC.RegisterBlock(BlockId.new(17,14), true, "birch_log", "axis=none") + AC.RegisterBlock(BlockId.new(17,15), true, "jungle_log", "axis=none") + + AC.RegisterBlock(BlockId.new(18,0), true, "oak_leaves", "normal") + AC.RegisterBlock(BlockId.new(18,1), true, "spruce_leaves", "normal") + AC.RegisterBlock(BlockId.new(18,2), true, "birch_leaves", "normal") + AC.RegisterBlock(BlockId.new(18,3), true, "jungle_leaves", "normal") + AC.RegisterBlock(BlockId.new(18,4), true, "oak_leaves", "normal") + AC.RegisterBlock(BlockId.new(18,5), true, "spruce_leaves", "normal") + AC.RegisterBlock(BlockId.new(18,6), true, "birch_leaves", "normal") + AC.RegisterBlock(BlockId.new(18,7), true, "jungle_leaves", "normal") + AC.RegisterBlock(BlockId.new(18,8), true, "oak_leaves", "normal") + AC.RegisterBlock(BlockId.new(18,9), true, "spruce_leaves", "normal") + AC.RegisterBlock(BlockId.new(18,10), true, "birch_leaves", "normal") + AC.RegisterBlock(BlockId.new(18,11), true, "jungle_leaves", "normal") + AC.RegisterBlock(BlockId.new(18,12), true, "oak_leaves", "normal") + AC.RegisterBlock(BlockId.new(18,13), true, "spruce_leaves", "normal") + AC.RegisterBlock(BlockId.new(18,14), true, "birch_leaves", "normal") + AC.RegisterBlock(BlockId.new(18,15), true, "jungle_leaves", "normal") + + AC.RegisterBlock(BlockId.new(20,0), true, "glass", "normal") + + AC.RegisterBlock(BlockId.new(21,0), true, "lapis_ore", "normal") + + AC.RegisterBlock(BlockId.new(22,0), true, "lapis_block", "normal") + + AC.RegisterBlock(BlockId.new(24,0), true, "sandstone", "normal") + AC.RegisterBlock(BlockId.new(24,1), true, "chiseled_sandstone", "normal") + AC.RegisterBlock(BlockId.new(24,2), true, "smooth_sandstone", "normal") + + AC.RegisterBlock(BlockId.new(30,0), true, "web", "normal") + + AC.RegisterBlock(BlockId.new(31,0), false, "dead_bush", "normal") AC.RegisterBlock(BlockId.new(31,1), false, "tall_grass", "normal") + AC.RegisterBlock(BlockId.new(31,2), false, "fern", "normal") + + AC.RegisterBlock(BlockId.new(32,0), false, "dead_bush", "normal") + + AC.RegisterBlock(BlockId.new(35,0), true, "white_wool", "normal") + AC.RegisterBlock(BlockId.new(35,1), true, "orange_wool", "normal") + AC.RegisterBlock(BlockId.new(35,2), true, "magenta_wool", "normal") + AC.RegisterBlock(BlockId.new(35,3), true, "light_blue_wool", "normal") + AC.RegisterBlock(BlockId.new(35,4), true, "yellow_wool", "normal") + AC.RegisterBlock(BlockId.new(35,5), true, "lime_wool", "normal") + AC.RegisterBlock(BlockId.new(35,6), true, "pink_wool", "normal") + AC.RegisterBlock(BlockId.new(35,7), true, "gray_wool", "normal") + AC.RegisterBlock(BlockId.new(35,8), true, "silver_wool", "normal") + AC.RegisterBlock(BlockId.new(35,9), true, "cyan_wool", "normal") + AC.RegisterBlock(BlockId.new(35,10), true, "purple_wool", "normal") + AC.RegisterBlock(BlockId.new(35,11), true, "blue_wool", "normal") + AC.RegisterBlock(BlockId.new(35,12), true, "brown_wool", "normal") + AC.RegisterBlock(BlockId.new(35,13), true, "green_wool", "normal") + AC.RegisterBlock(BlockId.new(35,14), true, "red_wool", "normal") + AC.RegisterBlock(BlockId.new(35,15), true, "black_wool", "normal") + + AC.RegisterBlock(BlockId.new(37,0), false, "dandelion", "normal") + + AC.RegisterBlock(BlockId.new(38,0), false, "poppy", "normal") + AC.RegisterBlock(BlockId.new(38,1), false, "blue_orchid", "normal") + AC.RegisterBlock(BlockId.new(38,2), false, "allium", "normal") + AC.RegisterBlock(BlockId.new(38,3), false, "houstonia", "normal") + AC.RegisterBlock(BlockId.new(38,4), false, "red_tulip", "normal") + AC.RegisterBlock(BlockId.new(38,5), false, "orange_tulip", "normal") + AC.RegisterBlock(BlockId.new(38,6), false, "white_tulip", "normal") + AC.RegisterBlock(BlockId.new(38,7), false, "pink_tulip", "normal") + AC.RegisterBlock(BlockId.new(38,8), false, "oxeye_daisy", "normal") + + AC.RegisterBlock(BlockId.new(39,0), false, "brown_mushroom", "normal") + + AC.RegisterBlock(BlockId.new(40,0), false, "red_mushroom", "normal") + + AC.RegisterBlock(BlockId.new(41,0), true, "gold_block", "normal") + + AC.RegisterBlock(BlockId.new(44,0), true, "stone_slab", "half=bottom") + AC.RegisterBlock(BlockId.new(44,8), true, "stone_slab", "half=top") + + AC.RegisterBlock(BlockId.new(45,0), true, "brick_block", "normal") + + AC.RegisterBlock(BlockId.new(46,0), true, "tnt", "normal") + + AC.RegisterBlock(BlockId.new(47,0), true, "bookshelf", "normal") + + AC.RegisterBlock(BlockId.new(48,0), true, "mossy_cobblestone", "normal") + + AC.RegisterBlock(BlockId.new(49,0), true, "obsidian", "normal") + + AC.RegisterBlock(BlockId.new(50,1), true, "torch", "facing=east") + AC.RegisterBlock(BlockId.new(50,2), true, "torch", "facing=west") + AC.RegisterBlock(BlockId.new(50,3), true, "torch", "facing=south") + AC.RegisterBlock(BlockId.new(50,4), true, "torch", "facing=north") + AC.RegisterBlock(BlockId.new(50,5), true, "torch", "facing=up") + + AC.RegisterBlock(BlockId.new(53,0), true, "oak_stairs", "facing=east,half=bottom,shape=straight") + AC.RegisterBlock(BlockId.new(53,1), true, "oak_stairs", "facing=west,half=bottom,shape=straight") + AC.RegisterBlock(BlockId.new(53,2), true, "oak_stairs", "facing=south,half=bottom,shape=straight") + AC.RegisterBlock(BlockId.new(53,3), true, "oak_stairs", "facing=north,half=bottom,shape=straight") + AC.RegisterBlock(BlockId.new(53,4), true, "oak_stairs", "facing=east,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(53,5), true, "oak_stairs", "facing=west,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(53,6), true, "oak_stairs", "facing=south,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(53,7), true, "oak_stairs", "facing=north,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(53,8), true, "oak_stairs", "facing=east,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(53,9), true, "oak_stairs", "facing=west,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(53,10), true, "oak_stairs", "facing=south,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(53,11), true, "oak_stairs", "facing=north,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(53,12), true, "oak_stairs", "facing=east,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(53,13), true, "oak_stairs", "facing=west,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(53,14), true, "oak_stairs", "facing=south,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(53,15), true, "oak_stairs", "facing=north,half=top,shape=straight") + + AC.RegisterBlock(BlockId.new(56,0), true, "diamond_ore", "normal") + + AC.RegisterBlock(BlockId.new(57,0), true, "diamond_block", "normal") + + AC.RegisterBlock(BlockId.new(59,0), true, "wheat", "age=0") + AC.RegisterBlock(BlockId.new(59,1), true, "wheat", "age=1") + AC.RegisterBlock(BlockId.new(59,2), true, "wheat", "age=2") + AC.RegisterBlock(BlockId.new(59,3), true, "wheat", "age=3") + AC.RegisterBlock(BlockId.new(59,4), true, "wheat", "age=4") + AC.RegisterBlock(BlockId.new(59,5), true, "wheat", "age=5") + AC.RegisterBlock(BlockId.new(59,6), true, "wheat", "age=6") + AC.RegisterBlock(BlockId.new(59,7), true, "wheat", "age=7") + AC.RegisterBlock(BlockId.new(59,8), true, "wheat", "age=8") + AC.RegisterBlock(BlockId.new(59,9), true, "wheat", "age=9") + AC.RegisterBlock(BlockId.new(59,10), true, "wheat", "age=10") + AC.RegisterBlock(BlockId.new(59,11), true, "wheat", "age=11") + AC.RegisterBlock(BlockId.new(59,12), true, "wheat", "age=12") + AC.RegisterBlock(BlockId.new(59,13), true, "wheat", "age=13") + AC.RegisterBlock(BlockId.new(59,14), true, "wheat", "age=14") + AC.RegisterBlock(BlockId.new(59,15), true, "wheat", "age=15") + + AC.RegisterBlock(BlockId.new(60,0), true, "farmland", "moisture=7") + AC.RegisterBlock(BlockId.new(60,1), true, "farmland", "moisture=6") + AC.RegisterBlock(BlockId.new(60,2), true, "farmland", "moisture=5") + AC.RegisterBlock(BlockId.new(60,3), true, "farmland", "moisture=4") + AC.RegisterBlock(BlockId.new(60,4), true, "farmland", "moisture=3") + AC.RegisterBlock(BlockId.new(60,5), true, "farmland", "moisture=2") + AC.RegisterBlock(BlockId.new(60,6), true, "farmland", "moisture=1") + AC.RegisterBlock(BlockId.new(60,7), true, "farmland", "moisture=0") + AC.RegisterBlock(BlockId.new(60,8), true, "farmland", "moisture=-1") + AC.RegisterBlock(BlockId.new(60,9), true, "farmland", "moisture=-2") + AC.RegisterBlock(BlockId.new(60,10), true, "farmland", "moisture=-3") + AC.RegisterBlock(BlockId.new(60,11), true, "farmland", "moisture=-4") + AC.RegisterBlock(BlockId.new(60,12), true, "farmland", "moisture=-5") + AC.RegisterBlock(BlockId.new(60,13), true, "farmland", "moisture=-6") + AC.RegisterBlock(BlockId.new(60,14), true, "farmland", "moisture=-7") + AC.RegisterBlock(BlockId.new(60,15), true, "farmland", "moisture=-8") + + AC.RegisterBlock(BlockId.new(61,0), true, "furnace", "") + AC.RegisterBlock(BlockId.new(61,2), true, "furnace", "facing=north") + AC.RegisterBlock(BlockId.new(61,3), true, "furnace", "facing=south") + AC.RegisterBlock(BlockId.new(61,4), true, "furnace", "facing=west") + AC.RegisterBlock(BlockId.new(61,5), true, "furnace", "facing=east") + AC.RegisterBlock(BlockId.new(61,6), true, "furnace", "") + + AC.RegisterBlock(BlockId.new(64,0), true, "wooden_door", "facing=east,half=upper,hinge=right,open=false") + AC.RegisterBlock(BlockId.new(64,1), true, "wooden_door", "facing=east,half=upper,hinge=left,open=false") + AC.RegisterBlock(BlockId.new(64,2), true, "wooden_door", "facing=east,half=upper,hinge=right,open=false") + AC.RegisterBlock(BlockId.new(64,3), true, "wooden_door", "facing=east,half=upper,hinge=left,open=false") + AC.RegisterBlock(BlockId.new(64,4), true, "wooden_door", "facing=east,half=upper,hinge=right,open=false") + AC.RegisterBlock(BlockId.new(64,5), true, "wooden_door", "facing=east,half=upper,hinge=left,open=false") + AC.RegisterBlock(BlockId.new(64,6), true, "wooden_door", "facing=east,half=upper,hinge=right,open=false") + AC.RegisterBlock(BlockId.new(64,7), true, "wooden_door", "facing=east,half=upper,hinge=left,open=false") + AC.RegisterBlock(BlockId.new(64,8), true, "wooden_door", "facing=west,half=lower,hinge=left,open=false") + AC.RegisterBlock(BlockId.new(64,10), true, "wooden_door", "facing=west,half=lower,hinge=left,open=true") + AC.RegisterBlock(BlockId.new(64,12), true, "wooden_door", "facing=north,half=lower,hinge=left,open=false") + AC.RegisterBlock(BlockId.new(64,14), true, "wooden_door", "facing=north,half=lower,hinge=left,open=true") + + AC.RegisterBlock(BlockId.new(67,0), true, "stone_stairs", "facing=east,half=bottom,shape=straight") + AC.RegisterBlock(BlockId.new(67,1), true, "stone_stairs", "facing=west,half=bottom,shape=straight") + AC.RegisterBlock(BlockId.new(67,2), true, "stone_stairs", "facing=south,half=bottom,shape=straight") + AC.RegisterBlock(BlockId.new(67,3), true, "stone_stairs", "facing=north,half=bottom,shape=straight") + AC.RegisterBlock(BlockId.new(67,4), true, "stone_stairs", "facing=east,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(67,5), true, "stone_stairs", "facing=west,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(67,6), true, "stone_stairs", "facing=south,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(67,7), true, "stone_stairs", "facing=north,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(67,8), true, "stone_stairs", "facing=east,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(67,9), true, "stone_stairs", "facing=west,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(67,10), true, "stone_stairs", "facing=south,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(67,11), true, "stone_stairs", "facing=north,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(67,12), true, "stone_stairs", "facing=east,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(67,13), true, "stone_stairs", "facing=west,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(67,14), true, "stone_stairs", "facing=south,half=top,shape=straight") + AC.RegisterBlock(BlockId.new(67,15), true, "stone_stairs", "facing=north,half=top,shape=straight") + + AC.RegisterBlock(BlockId.new(69,0), true, "lever", "facing=down_x,powered=false") + AC.RegisterBlock(BlockId.new(69,1), true, "lever", "facing=east,powered=false") + AC.RegisterBlock(BlockId.new(69,2), true, "lever", "facing=west,powered=false") + AC.RegisterBlock(BlockId.new(69,3), true, "lever", "facing=south,powered=false") + AC.RegisterBlock(BlockId.new(69,4), true, "lever", "facing=north,powered=false") + AC.RegisterBlock(BlockId.new(69,5), true, "lever", "facing=up_z,powered=false") + AC.RegisterBlock(BlockId.new(69,6), true, "lever", "facing=up_x,powered=false") + AC.RegisterBlock(BlockId.new(69,7), true, "lever", "facing=down_z,powered=false") + AC.RegisterBlock(BlockId.new(69,8), true, "lever", "facing=down_x,powered=true") + AC.RegisterBlock(BlockId.new(69,9), true, "lever", "facing=east,powered=true") + AC.RegisterBlock(BlockId.new(69,10), true, "lever", "facing=west,powered=true") + AC.RegisterBlock(BlockId.new(69,11), true, "lever", "facing=south,powered=true") + AC.RegisterBlock(BlockId.new(69,12), true, "lever", "facing=north,powered=true") + AC.RegisterBlock(BlockId.new(69,13), true, "lever", "facing=up_z,powered=true") + AC.RegisterBlock(BlockId.new(69,14), true, "lever", "facing=up_x,powered=true") + AC.RegisterBlock(BlockId.new(69,15), true, "lever", "facing=down_z,powered=true") + + AC.RegisterBlock(BlockId.new(73,0), true, "redstone_ore", "normal") + + AC.RegisterBlock(BlockId.new(74,0), true, "redstone_ore", "normal") + + AC.RegisterBlock(BlockId.new(78,0), true, "snow_layer", "layers=1") + AC.RegisterBlock(BlockId.new(78,1), true, "snow_layer", "layers=2") + AC.RegisterBlock(BlockId.new(78,2), true, "snow_layer", "layers=3") + AC.RegisterBlock(BlockId.new(78,3), true, "snow_layer", "layers=4") + AC.RegisterBlock(BlockId.new(78,4), true, "snow_layer", "layers=5") + AC.RegisterBlock(BlockId.new(78,5), true, "snow_layer", "layers=6") + AC.RegisterBlock(BlockId.new(78,6), true, "snow_layer", "layers=7") + AC.RegisterBlock(BlockId.new(78,7), true, "snow_layer", "layers=8") + + AC.RegisterBlock(BlockId.new(79,0), true, "ice", "normal") + + AC.RegisterBlock(BlockId.new(80,0), true, "snow", "normal") + + AC.RegisterBlock(BlockId.new(81,0), true, "cactus", "normal") + + AC.RegisterBlock(BlockId.new(82,0), true, "clay", "normal") + + AC.RegisterBlock(BlockId.new(83,0), true, "reeds", "normal") + + AC.RegisterBlock(BlockId.new(86,0), true, "pumpkin", "facing=south") + AC.RegisterBlock(BlockId.new(86,1), true, "pumpkin", "facing=west") + AC.RegisterBlock(BlockId.new(86,2), true, "pumpkin", "facing=north") + AC.RegisterBlock(BlockId.new(86,3), true, "pumpkin", "facing=east") + + AC.RegisterBlock(BlockId.new(87,0), true, "netherrack", "normal") + + AC.RegisterBlock(BlockId.new(88,0), true, "soul_sand", "normal") + + AC.RegisterBlock(BlockId.new(89,0), true, "glowstone", "normal") + + AC.RegisterBlock(BlockId.new(90,0), true, "portal", "axis=z") + AC.RegisterBlock(BlockId.new(90,1), true, "portal", "axis=x") + AC.RegisterBlock(BlockId.new(90,2), true, "portal", "axis=z") + + AC.RegisterBlock(BlockId.new(93,0), true, "unpowered_repeater", "delay=1,facing=east,locked=false") + AC.RegisterBlock(BlockId.new(93,1), true, "unpowered_repeater", "delay=1,facing=south,locked=false") + AC.RegisterBlock(BlockId.new(93,2), true, "unpowered_repeater", "delay=1,facing=west,locked=false") + AC.RegisterBlock(BlockId.new(93,3), true, "unpowered_repeater", "delay=1,facing=north,locked=false") + AC.RegisterBlock(BlockId.new(93,4), true, "unpowered_repeater", "delay=2,facing=east,locked=false") + AC.RegisterBlock(BlockId.new(93,5), true, "unpowered_repeater", "delay=2,facing=south,locked=false") + AC.RegisterBlock(BlockId.new(93,6), true, "unpowered_repeater", "delay=2,facing=west,locked=false") + AC.RegisterBlock(BlockId.new(93,7), true, "unpowered_repeater", "delay=2,facing=north,locked=false") + AC.RegisterBlock(BlockId.new(93,8), true, "unpowered_repeater", "delay=3,facing=east,locked=false") + AC.RegisterBlock(BlockId.new(93,9), true, "unpowered_repeater", "delay=3,facing=south,locked=false") + AC.RegisterBlock(BlockId.new(93,10), true, "unpowered_repeater", "delay=3,facing=west,locked=false") + AC.RegisterBlock(BlockId.new(93,11), true, "unpowered_repeater", "delay=3,facing=north,locked=false") + AC.RegisterBlock(BlockId.new(93,12), true, "unpowered_repeater", "delay=4,facing=east,locked=false") + AC.RegisterBlock(BlockId.new(93,13), true, "unpowered_repeater", "delay=4,facing=south,locked=false") + AC.RegisterBlock(BlockId.new(93,14), true, "unpowered_repeater", "delay=4,facing=west,locked=false") + AC.RegisterBlock(BlockId.new(93,15), true, "unpowered_repeater", "delay=4,facing=north,locked=false") + + AC.RegisterBlock(BlockId.new(94,0), true, "powered_repeater", "delay=1,facing=east,locked=false") + AC.RegisterBlock(BlockId.new(94,1), true, "powered_repeater", "delay=1,facing=south,locked=false") + AC.RegisterBlock(BlockId.new(94,2), true, "powered_repeater", "delay=1,facing=west,locked=false") + AC.RegisterBlock(BlockId.new(94,3), true, "powered_repeater", "delay=1,facing=north,locked=false") + AC.RegisterBlock(BlockId.new(94,4), true, "powered_repeater", "delay=2,facing=east,locked=false") + AC.RegisterBlock(BlockId.new(94,5), true, "powered_repeater", "delay=2,facing=south,locked=false") + AC.RegisterBlock(BlockId.new(94,6), true, "powered_repeater", "delay=2,facing=west,locked=false") + AC.RegisterBlock(BlockId.new(94,7), true, "powered_repeater", "delay=2,facing=north,locked=false") + AC.RegisterBlock(BlockId.new(94,8), true, "powered_repeater", "delay=3,facing=east,locked=false") + AC.RegisterBlock(BlockId.new(94,9), true, "powered_repeater", "delay=3,facing=south,locked=false") + AC.RegisterBlock(BlockId.new(94,10), true, "powered_repeater", "delay=3,facing=west,locked=false") + AC.RegisterBlock(BlockId.new(94,11), true, "powered_repeater", "delay=3,facing=north,locked=false") + AC.RegisterBlock(BlockId.new(94,12), true, "powered_repeater", "delay=4,facing=east,locked=false") + AC.RegisterBlock(BlockId.new(94,13), true, "powered_repeater", "delay=4,facing=south,locked=false") + AC.RegisterBlock(BlockId.new(94,14), true, "powered_repeater", "delay=4,facing=west,locked=false") + AC.RegisterBlock(BlockId.new(94,15), true, "powered_repeater", "delay=4,facing=north,locked=false") + + AC.RegisterBlock(BlockId.new(99,0), true, "brown_mushroom_block", "variant=all_inside") + AC.RegisterBlock(BlockId.new(99,1), true, "brown_mushroom_block", "variant=north_west") + AC.RegisterBlock(BlockId.new(99,2), true, "brown_mushroom_block", "variant=north") + AC.RegisterBlock(BlockId.new(99,3), true, "brown_mushroom_block", "variant=north_east") + AC.RegisterBlock(BlockId.new(99,4), true, "brown_mushroom_block", "variant=west") + AC.RegisterBlock(BlockId.new(99,5), true, "brown_mushroom_block", "variant=center") + AC.RegisterBlock(BlockId.new(99,6), true, "brown_mushroom_block", "variant=east") + AC.RegisterBlock(BlockId.new(99,7), true, "brown_mushroom_block", "variant=south_west") + AC.RegisterBlock(BlockId.new(99,8), true, "brown_mushroom_block", "variant=south") + AC.RegisterBlock(BlockId.new(99,9), true, "brown_mushroom_block", "variant=south_east") + AC.RegisterBlock(BlockId.new(99,10), true, "brown_mushroom_block", "variant=stem") + AC.RegisterBlock(BlockId.new(99,11), true, "brown_mushroom_block", "variant=all_outside") + AC.RegisterBlock(BlockId.new(99,12), true, "brown_mushroom_block", "variant=all_stem") + AC.RegisterBlock(BlockId.new(99,13), true, "brown_mushroom_block", "") + + AC.RegisterBlock(BlockId.new(100,0), true, "red_mushroom_block", "variant=all_inside") + AC.RegisterBlock(BlockId.new(100,1), true, "red_mushroom_block", "variant=north_west") + AC.RegisterBlock(BlockId.new(100,2), true, "red_mushroom_block", "variant=north") + AC.RegisterBlock(BlockId.new(100,3), true, "red_mushroom_block", "variant=north_east") + AC.RegisterBlock(BlockId.new(100,4), true, "red_mushroom_block", "variant=west") + AC.RegisterBlock(BlockId.new(100,5), true, "red_mushroom_block", "variant=center") + AC.RegisterBlock(BlockId.new(100,6), true, "red_mushroom_block", "variant=east") + AC.RegisterBlock(BlockId.new(100,7), true, "red_mushroom_block", "variant=south_west") + AC.RegisterBlock(BlockId.new(100,8), true, "red_mushroom_block", "variant=south") + AC.RegisterBlock(BlockId.new(100,9), true, "red_mushroom_block", "variant=south_east") + AC.RegisterBlock(BlockId.new(100,10), true, "red_mushroom_block", "variant=stem") + AC.RegisterBlock(BlockId.new(100,11), true, "red_mushroom_block", "variant=all_outside") + AC.RegisterBlock(BlockId.new(100,12), true, "red_mushroom_block", "variant=all_stem") + AC.RegisterBlock(BlockId.new(100,13), true, "red_mushroom_block", "") + + AC.RegisterBlock(BlockId.new(103,0), true, "melon_block", "normal") + + AC.RegisterBlock(BlockId.new(106,0), true, "vine", "east=false,north=false,south=false,up=true,west=false") + AC.RegisterBlock(BlockId.new(106,1), true, "vine", "east=false,north=false,south=true,up=false,west=false") + AC.RegisterBlock(BlockId.new(106,2), true, "vine", "east=false,north=false,south=false,up=false,west=true") + AC.RegisterBlock(BlockId.new(106,3), true, "vine", "east=false,north=false,south=true,up=false,west=true") + AC.RegisterBlock(BlockId.new(106,4), true, "vine", "east=false,north=true,south=false,up=false,west=false") + AC.RegisterBlock(BlockId.new(106,5), true, "vine", "east=false,north=true,south=true,up=false,west=false") + AC.RegisterBlock(BlockId.new(106,6), true, "vine", "east=false,north=true,south=false,up=false,west=true") + AC.RegisterBlock(BlockId.new(106,7), true, "vine", "east=false,north=true,south=true,up=false,west=true") + AC.RegisterBlock(BlockId.new(106,8), true, "vine", "east=true,north=false,south=false,up=false,west=false") + AC.RegisterBlock(BlockId.new(106,9), true, "vine", "east=true,north=false,south=true,up=false,west=false") + AC.RegisterBlock(BlockId.new(106,10), true, "vine", "east=true,north=false,south=false,up=false,west=true") + AC.RegisterBlock(BlockId.new(106,11), true, "vine", "east=true,north=false,south=true,up=false,west=true") + AC.RegisterBlock(BlockId.new(106,12), true, "vine", "east=true,north=true,south=false,up=false,west=false") + AC.RegisterBlock(BlockId.new(106,13), true, "vine", "east=true,north=true,south=true,up=false,west=false") + AC.RegisterBlock(BlockId.new(106,14), true, "vine", "east=true,north=true,south=false,up=false,west=true") + AC.RegisterBlock(BlockId.new(106,15), true, "vine", "east=true,north=true,south=true,up=false,west=true") + + AC.RegisterBlock(BlockId.new(111,0), true, "waterlily", "normal") + + AC.RegisterBlock(BlockId.new(112,0), true, "nether_brick", "normal") + + AC.RegisterBlock(BlockId.new(121,0), true, "end_stone", "normal") + + AC.RegisterBlock(BlockId.new(129,0), true, "emerald_ore", "normal") + + AC.RegisterBlock(BlockId.new(133,0), true, "emerald_block", "normal") + + AC.RegisterBlock(BlockId.new(141,0), true, "carrots", "age=0") + AC.RegisterBlock(BlockId.new(141,1), true, "carrots", "age=1") + AC.RegisterBlock(BlockId.new(141,2), true, "carrots", "age=2") + AC.RegisterBlock(BlockId.new(141,3), true, "carrots", "age=3") + AC.RegisterBlock(BlockId.new(141,4), true, "carrots", "age=4") + AC.RegisterBlock(BlockId.new(141,5), true, "carrots", "age=5") + AC.RegisterBlock(BlockId.new(141,6), true, "carrots", "age=6") + AC.RegisterBlock(BlockId.new(141,7), true, "carrots", "age=7") + AC.RegisterBlock(BlockId.new(141,8), true, "carrots", "age=8") + AC.RegisterBlock(BlockId.new(141,9), true, "carrots", "age=9") + AC.RegisterBlock(BlockId.new(141,10), true, "carrots", "age=10") + AC.RegisterBlock(BlockId.new(141,11), true, "carrots", "age=11") + AC.RegisterBlock(BlockId.new(141,12), true, "carrots", "age=12") + AC.RegisterBlock(BlockId.new(141,13), true, "carrots", "age=13") + AC.RegisterBlock(BlockId.new(141,14), true, "carrots", "age=14") + AC.RegisterBlock(BlockId.new(141,15), true, "carrots", "age=15") + + AC.RegisterBlock(BlockId.new(142,0), true, "potatoes", "age=0") + AC.RegisterBlock(BlockId.new(142,1), true, "potatoes", "age=1") + AC.RegisterBlock(BlockId.new(142,2), true, "potatoes", "age=2") + AC.RegisterBlock(BlockId.new(142,3), true, "potatoes", "age=3") + AC.RegisterBlock(BlockId.new(142,4), true, "potatoes", "age=4") + AC.RegisterBlock(BlockId.new(142,5), true, "potatoes", "age=5") + AC.RegisterBlock(BlockId.new(142,6), true, "potatoes", "age=6") + AC.RegisterBlock(BlockId.new(142,7), true, "potatoes", "age=7") + AC.RegisterBlock(BlockId.new(142,8), true, "potatoes", "age=8") + AC.RegisterBlock(BlockId.new(142,9), true, "potatoes", "age=9") + AC.RegisterBlock(BlockId.new(142,10), true, "potatoes", "age=10") + AC.RegisterBlock(BlockId.new(142,11), true, "potatoes", "age=11") + AC.RegisterBlock(BlockId.new(142,12), true, "potatoes", "age=12") + AC.RegisterBlock(BlockId.new(142,13), true, "potatoes", "age=13") + AC.RegisterBlock(BlockId.new(142,14), true, "potatoes", "age=14") + AC.RegisterBlock(BlockId.new(142,15), true, "potatoes", "age=15") + + AC.RegisterBlock(BlockId.new(149,0), true, "unpowered_comparator", "facing=east,mode=compare,powered=false") + AC.RegisterBlock(BlockId.new(149,1), true, "unpowered_comparator", "facing=south,mode=compare,powered=false") + AC.RegisterBlock(BlockId.new(149,2), true, "unpowered_comparator", "facing=west,mode=compare,powered=false") + AC.RegisterBlock(BlockId.new(149,3), true, "unpowered_comparator", "facing=north,mode=compare,powered=false") + AC.RegisterBlock(BlockId.new(149,4), true, "unpowered_comparator", "facing=east,mode=subtract,powered=false") + AC.RegisterBlock(BlockId.new(149,5), true, "unpowered_comparator", "facing=south,mode=subtract,powered=false") + AC.RegisterBlock(BlockId.new(149,6), true, "unpowered_comparator", "facing=west,mode=subtract,powered=false") + AC.RegisterBlock(BlockId.new(149,7), true, "unpowered_comparator", "facing=north,mode=subtract,powered=false") + AC.RegisterBlock(BlockId.new(149,8), true, "unpowered_comparator", "facing=east,mode=compare,powered=true") + AC.RegisterBlock(BlockId.new(149,9), true, "unpowered_comparator", "facing=south,mode=compare,powered=true") + AC.RegisterBlock(BlockId.new(149,10), true, "unpowered_comparator", "facing=west,mode=compare,powered=true") + AC.RegisterBlock(BlockId.new(149,11), true, "unpowered_comparator", "facing=north,mode=compare,powered=true") + AC.RegisterBlock(BlockId.new(149,12), true, "unpowered_comparator", "facing=east,mode=subtract,powered=true") + AC.RegisterBlock(BlockId.new(149,13), true, "unpowered_comparator", "facing=south,mode=subtract,powered=true") + AC.RegisterBlock(BlockId.new(149,14), true, "unpowered_comparator", "facing=west,mode=subtract,powered=true") + AC.RegisterBlock(BlockId.new(149,15), true, "unpowered_comparator", "facing=north,mode=subtract,powered=true") + + AC.RegisterBlock(BlockId.new(153,0), true, "quartz_ore", "normal") + + + AC.RegisterBlock(BlockId.new(155,0), true, "quartz_block", "normal") + + AC.RegisterBlock(BlockId.new(161,0), true, "acacia_leaves", "normal") + AC.RegisterBlock(BlockId.new(161,1), true, "dark_oak_leaves", "normal") + AC.RegisterBlock(BlockId.new(161,4), true, "acacia_leaves", "normal") + AC.RegisterBlock(BlockId.new(161,5), true, "dark_oak_leaves", "normal") + AC.RegisterBlock(BlockId.new(161,8), true, "acacia_leaves", "normal") + AC.RegisterBlock(BlockId.new(161,9), true, "dark_oak_leaves", "normal") + AC.RegisterBlock(BlockId.new(161,12), true, "acacia_leaves", "normal") + AC.RegisterBlock(BlockId.new(161,13), true, "dark_oak_leaves", "normal") + + AC.RegisterBlock(BlockId.new(162,0), true, "acacia_log", "axis=y") + AC.RegisterBlock(BlockId.new(162,1), true, "dark_oak_log", "axis=y") + AC.RegisterBlock(BlockId.new(162,4), true, "acacia_log", "axis=x") + AC.RegisterBlock(BlockId.new(162,5), true, "dark_oak_log", "axis=x") + AC.RegisterBlock(BlockId.new(162,8), true, "acacia_log", "axis=z") + AC.RegisterBlock(BlockId.new(162,9), true, "dark_oak_log", "axis=z") + AC.RegisterBlock(BlockId.new(162,12), true, "acacia_log", "axis=none") + AC.RegisterBlock(BlockId.new(162,13), true, "dark_oak_log", "axis=none") + + AC.RegisterBlock(BlockId.new(175,0), false, "sunflower", "half=lower") + AC.RegisterBlock(BlockId.new(175,1), false, "syringa", "half=lower") + AC.RegisterBlock(BlockId.new(175,2), false, "double_grass", "half=lower") + AC.RegisterBlock(BlockId.new(175,3), false, "double_fern", "half=lower") + AC.RegisterBlock(BlockId.new(175,4), false, "double_rose", "half=lower") + AC.RegisterBlock(BlockId.new(175,5), false, "paeonia", "half=lower") + AC.RegisterBlock(BlockId.new(175,8), false, "sunflower", "half=upper") + AC.RegisterBlock(BlockId.new(175,9), false, "syringa", "half=upper") + AC.RegisterBlock(BlockId.new(175,10), false, "double_grass", "half=upper") + AC.RegisterBlock(BlockId.new(175,11), false, "double_fern", "half=upper") + AC.RegisterBlock(BlockId.new(175,12), false, "double_rose", "half=upper") + AC.RegisterBlock(BlockId.new(175,13), false, "paeonia", "half=upper") + + AC.RegisterBlock(BlockId.new(207,0), true, "beetroots", "age=0") + AC.RegisterBlock(BlockId.new(207,1), true, "beetroots", "age=1") + AC.RegisterBlock(BlockId.new(207,2), true, "beetroots", "age=2") + AC.RegisterBlock(BlockId.new(207,3), true, "beetroots", "age=3") + AC.RegisterBlock(BlockId.new(207,4), true, "beetroots", "age=4") + AC.RegisterBlock(BlockId.new(207,5), true, "beetroots", "age=5") + AC.RegisterBlock(BlockId.new(207,6), true, "beetroots", "age=6") + AC.RegisterBlock(BlockId.new(207,7), true, "beetroots", "age=7") + AC.RegisterBlock(BlockId.new(207,8), true, "beetroots", "age=8") + AC.RegisterBlock(BlockId.new(207,9), true, "beetroots", "age=9") + AC.RegisterBlock(BlockId.new(207,10), true, "beetroots", "age=10") + AC.RegisterBlock(BlockId.new(207,11), true, "beetroots", "age=11") + AC.RegisterBlock(BlockId.new(207,12), true, "beetroots", "age=12") + AC.RegisterBlock(BlockId.new(207,13), true, "beetroots", "age=13") + AC.RegisterBlock(BlockId.new(207,14), true, "beetroots", "age=14") + AC.RegisterBlock(BlockId.new(207,15), true, "beetroots", "age=15") + + AC.RegisterBlock(BlockId.new(208,0), true, "grass_path", "normal") end return { diff --git a/src/Block.cpp b/src/Block.cpp index 421cb5d..48c099d 100644 --- a/src/Block.cpp +++ b/src/Block.cpp @@ -4,530 +4,6 @@ #include "Plugin.hpp" -std::pair TransformBlockIdToBlockStateName(BlockId blockId) { - switch (blockId.id) { - case 1: { - if (blockId.state > 6) - break; - static const std::pair ids[] = { - std::pair("stone", "normal"), - std::pair("granite", "normal"), - std::pair("smooth_granite", "normal"), - std::pair("diorite", "normal"), - std::pair("smooth_diorite", "normal"), - std::pair("andesite", "normal"), - std::pair("smooth_andesite", "normal"), - }; - return ids[blockId.state]; - } - case 2: { - return std::make_pair("grass", "snowy=false"); - } - case 3: { - 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]; - } - 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_planks", "normal"), - std::pair("jungle_planks", "normal"), - std::pair("acacia_planks", "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"); - } - case 10: - case 11: { - return std::make_pair("lava", "normal"); - } - 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 13: { - return std::make_pair("gravel", "normal"); - } - case 14: { - return std::make_pair("gold_ore", "normal"); - } - case 15: { - return std::make_pair("iron_ore", "normal"); - } - case 16: { - return std::make_pair("coal_ore", "normal"); - } - 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 20: { - return std::make_pair("glass", "normal"); - } - 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; - static const std::pair ids[] = { - std::pair("dead_bush", "normal"), - std::pair("tall_grass", "normal"), - std::pair("fern", "normal"), - }; - 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"), - 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("silver_wool", "normal"), - std::pair("cyan_wool", "normal"), - std::pair("purple_wool", "normal"), - std::pair("blue_wool", "normal"), - std::pair("brown_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("houstonia", "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 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"); - } - case 49: { - return std::make_pair("obsidian", "normal"); - } - case 50: { - if (blockId.state > 5) - break; - static const std::pair ids[] = { - std::pair("", ""), - std::pair("torch", "facing=east"), - std::pair("torch", "facing=west"), - std::pair("torch", "facing=south"), - std::pair("torch", "facing=north"), - std::pair("torch", "facing=up"), - }; - return ids[blockId.state]; - } - case 53: { - bool isUp = blockId.state >> 2; - unsigned char dir = blockId.state & 0x3; - static const std::string dirs[] = { - "facing=east,half=", - "facing=west,half=", - "facing=south,half=", - "facing=north,half=", - }; - - 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)); - } - case 60: { - return std::make_pair("farmland", "moisture=" + std::to_string(7 - blockId.state)); - } - case 61: { - static const std::string dirs[] = { - "", - "", - "facing=north", - "facing=south", - "facing=west", - "facing=east", - }; - return std::make_pair("furnace", dirs[blockId.state]); - } - case 64: { - bool isUp = !(blockId.state >> 3); - bool hingeIsLeft = true; - bool isOpen = 0; - unsigned char dir = 0; - if (isUp) - hingeIsLeft = blockId.state & 0x1; - else { - isOpen = (blockId.state >> 1) & 0x1; - dir = blockId.state >> 2; - } - static const std::string dirs[] = { - "east", - "south", - "west", - "north", - }; - - return std::make_pair("wooden_door", "facing=" + dirs[dir] + ",half=" + (isUp ? "upper" : "lower") + ",hinge=" + (hingeIsLeft ? "left" : "right") + ",open=" + (isOpen ? "true" : "false")); - } - case 67: { - bool isUp = blockId.state >> 2; - unsigned char dir = blockId.state & 0x3; - static const std::string dirs[] = { - "facing=east,half=", - "facing=west,half=", - "facing=south,half=", - "facing=north,half=", - }; - - return std::make_pair("stone_stairs", dirs[dir] + (isUp ? "top" : "bottom") + ",shape=straight"); - } - case 69: { - bool isActive = blockId.state >> 3; - static const std::string types[] = { - "facing=down_x", - "facing=east", - "facing=west", - "facing=south", - "facing=north", - "facing=up_z", - "facing=up_x", - "facing=down_z", - }; - - 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; - static const std::pair ids[] = { - std::pair("snow_layer", "layers=1"), - std::pair("snow_layer", "layers=2"), - std::pair("snow_layer", "layers=3"), - std::pair("snow_layer", "layers=4"), - std::pair("snow_layer", "layers=5"), - std::pair("snow_layer", "layers=6"), - std::pair("snow_layer", "layers=7"), - std::pair("snow_layer", "layers=8"), - }; - return ids[blockId.state]; - } - 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"); - } - case 86: { - if (blockId.state > 3) - break; - static const std::pair ids[] = { - std::pair("pumpkin", "facing=south"), - std::pair("pumpkin", "facing=west"), - std::pair("pumpkin", "facing=north"), - std::pair("pumpkin", "facing=east"), - }; - 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"); - } - case 90: { - return std::make_pair("portal", blockId.state == 1 ? "axis=x" : "axis=z"); - } - case 93: { - static const std::string dirs[] = { - "east", - "south", - "west", - "north", - }; - unsigned char dir = blockId.state & 0x3; - unsigned char delay = (blockId.state >> 2) + 1; - return std::make_pair("unpowered_repeater", "delay=" + std::to_string(delay) + ",facing=" + dirs[dir] + ",locked=false"); - } - case 94: { - static const std::string dirs[] = { - "east", - "south", - "west", - "north", - }; - unsigned char dir = blockId.state & 0x3; - 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", - "true", - }; - return std::make_pair("vine", "east=" + values[(blockId.state >> 3) & 0x1] + ",north=" + values[(blockId.state >> 2) & 0x1] + ",south=" + values[blockId.state & 0x1] + ",up=" + values[blockId.state == 0] + ",west=" + values[(blockId.state >> 1) & 0x1]); - } - 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)); - } - case 142: { - return std::make_pair("potatoes", "age=" + std::to_string(blockId.state)); - } - case 149: { - static const std::string dirs[] = { - "east", - "south", - "west", - "north", - }; - unsigned char dir = blockId.state & 0x3; - bool substractMode = (blockId.state >> 2) & 0x1; - 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; - - static const std::string types[] = { - "sunflower", - "syringa", - "double_grass", - "double_fern", - "double_rose", - "paeonia", - }; - - static const std::string isHigh[] = { - "half=lower", - "half=upper", - }; - return std::make_pair(types[type], isHigh[high]); - } - case 207: { - return std::make_pair("beetroots", "age=" + std::to_string(blockId.state)); - } - case 208: { - return std::make_pair("grass_path", "normal"); - } - default: - break; - } - - return std::make_pair("", ""); -} - std::map staticBlockInfo; void RegisterStaticBlockInfo(BlockId blockId, BlockInfo blockInfo) { diff --git a/src/Block.hpp b/src/Block.hpp index d8a78a8..fbeeaeb 100644 --- a/src/Block.hpp +++ b/src/Block.hpp @@ -41,9 +41,6 @@ namespace std { }; } -//returns name of blockstate and name of variant -std::pair TransformBlockIdToBlockStateName(BlockId blockId); - struct BlockInfo { bool collides; std::string blockstate; diff --git a/src/Render.cpp b/src/Render.cpp index 6218740..128c877 100644 --- a/src/Render.cpp +++ b/src/Render.cpp @@ -451,8 +451,8 @@ void Render::RenderGui() { AssetManager::GetAssetNameByBlockId(BlockId{ worldPtr->GetBlockId(selectionStatus.selectedBlock).id,0 }).c_str()); ImGui::Text("Selected block variant: %s:%s", - TransformBlockIdToBlockStateName(worldPtr->GetBlockId(selectionStatus.selectedBlock)).first.c_str(), - TransformBlockIdToBlockStateName(worldPtr->GetBlockId(selectionStatus.selectedBlock)).second.c_str()); + GetBlockInfo(worldPtr->GetBlockId(selectionStatus.selectedBlock)).blockstate.c_str(), + GetBlockInfo(worldPtr->GetBlockId(selectionStatus.selectedBlock)).variant.c_str()); } ImGui::End(); -- cgit v1.2.3