#define BLOCKTYPE_EMPTY 0u

#define BLOCKTYPE_LAYERS_2 1u
#define BLOCKTYPE_LAYERS_4 2u
#define BLOCKTYPE_LAYERS_6 3u
#define BLOCKTYPE_LAYERS_8 4u
#define BLOCKTYPE_LAYERS_10 5u
#define BLOCKTYPE_LAYERS_12 6u
#define BLOCKTYPE_LAYERS_14 7u

// #define BLOCKTYPE_LAYERS_1 1u
// #define BLOCKTYPE_LAYERS_3 3u
// #define BLOCKTYPE_LAYERS_9 3u
// #define BLOCKTYPE_LAYERS_15 7u

#define BLOCKTYPE_SOLID 8u

#define BLOCKTYPE_ANVIL_N_S 9u
#define BLOCKTYPE_ANVIL_W_E 10u
#define BLOCKTYPE_BELL_FLOOR_N_S 11u
#define BLOCKTYPE_BELL_FLOOR_W_E 12u
#define BLOCKTYPE_CACTUS 13u
#define BLOCKTYPE_CAKE 14u
#define BLOCKTYPE_CAMPFIRE_N_S 15u
#define BLOCKTYPE_CAMPFIRE_W_E 16u
#define BLOCKTYPE_CANDLE_CAKE 17u
#define BLOCKTYPE_CARPET 18u
#define BLOCKTYPE_CAULDRON 200u     // FIX THIS
#define BLOCKTYPE_END_PORTAL_FRAME 19u
#define BLOCKTYPE_FLOWER_POT 20u
#define BLOCKTYPE_GRINDSTONE_FLOOR_N_S 21u
#define BLOCKTYPE_GRINDSTONE_FLOOR_W_E 22u
#define BLOCKTYPE_GRINDSTONE_WALL_N_S 23u
#define BLOCKTYPE_GRINDSTONE_WALL_W_E 24u
#define BLOCKTYPE_HOPPER_DOWN 25u
#define BLOCKTYPE_HOPPER_N 26u
#define BLOCKTYPE_HOPPER_E 27u
#define BLOCKTYPE_HOPPER_S 28u
#define BLOCKTYPE_HOPPER_W 29u
#define BLOCKTYPE_LANTERN_CEIL 201u     // FIX THIS
#define BLOCKTYPE_LANTERN_FLOOR 202u     // FIX THIS
#define BLOCKTYPE_LECTERN 30u
#define BLOCKTYPE_LIGHTNING_ROD_N 31u
#define BLOCKTYPE_LIGHTNING_ROD_E 32u
#define BLOCKTYPE_LIGHTNING_ROD_S 33u
#define BLOCKTYPE_LIGHTNING_ROD_W 34u
#define BLOCKTYPE_LIGHTNING_ROD_UP 35u
#define BLOCKTYPE_LIGHTNING_ROD_DOWN 36u
#define BLOCKTYPE_PATHWAY 37u
#define BLOCKTYPE_PISTON_EXTENDED_N 38u
#define BLOCKTYPE_PISTON_EXTENDED_E 39u
#define BLOCKTYPE_PISTON_EXTENDED_S 40u
#define BLOCKTYPE_PISTON_EXTENDED_W 41u
#define BLOCKTYPE_PISTON_EXTENDED_UP 42u
#define BLOCKTYPE_PISTON_EXTENDED_DOWN 43u
#define BLOCKTYPE_PISTON_HEAD_N 44u
#define BLOCKTYPE_PISTON_HEAD_E 45u
#define BLOCKTYPE_PISTON_HEAD_S 46u
#define BLOCKTYPE_PISTON_HEAD_W 47u
#define BLOCKTYPE_PISTON_HEAD_UP 48u
#define BLOCKTYPE_PISTON_HEAD_DOWN 49u
#define BLOCKTYPE_PRESSURE_PLATE 50u
#define BLOCKTYPE_STONECUTTER 51u

#define BLOCKTYPE_BUTTON_FLOOR_N_S 52u
#define BLOCKTYPE_BUTTON_FLOOR_W_E 53u
#define BLOCKTYPE_BUTTON_CEILING_N_S 54u
#define BLOCKTYPE_BUTTON_CEILING_W_E 55u
#define BLOCKTYPE_BUTTON_WALL_N 56u
#define BLOCKTYPE_BUTTON_WALL_E 57u
#define BLOCKTYPE_BUTTON_WALL_S 58u
#define BLOCKTYPE_BUTTON_WALL_W 59u

#define BLOCKTYPE_DOOR_N 60u
#define BLOCKTYPE_DOOR_E 61u
#define BLOCKTYPE_DOOR_S 62u
#define BLOCKTYPE_DOOR_W 63u

#define BLOCKTYPE_LEVER_FLOOR_N_S 64u
#define BLOCKTYPE_LEVER_FLOOR_W_E 65u
#define BLOCKTYPE_LEVER_CEILING_N_S 66u
#define BLOCKTYPE_LEVER_CEILING_W_E 67u
#define BLOCKTYPE_LEVER_WALL_N 68u
#define BLOCKTYPE_LEVER_WALL_E 69u
#define BLOCKTYPE_LEVER_WALL_S 70u
#define BLOCKTYPE_LEVER_WALL_W 71u

#define BLOCKTYPE_TRAPDOOR_BOTTOM 72u
#define BLOCKTYPE_TRAPDOOR_TOP 73u
#define BLOCKTYPE_TRAPDOOR_N 74u
#define BLOCKTYPE_TRAPDOOR_E 75u
#define BLOCKTYPE_TRAPDOOR_S 76u
#define BLOCKTYPE_TRAPDOOR_W 77u

#define BLOCKTYPE_TRIPWIRE_HOOK_N 78u
#define BLOCKTYPE_TRIPWIRE_HOOK_E 79u
#define BLOCKTYPE_TRIPWIRE_HOOK_S 80u
#define BLOCKTYPE_TRIPWIRE_HOOK_W 81u

#define BLOCKTYPE_SLAB_TOP 82u

#define BLOCKTYPE_STAIRS_BOTTOM_N 83u
#define BLOCKTYPE_STAIRS_BOTTOM_E 84u
#define BLOCKTYPE_STAIRS_BOTTOM_S 85u
#define BLOCKTYPE_STAIRS_BOTTOM_W 86u
#define BLOCKTYPE_STAIRS_BOTTOM_INNER_N_W 87u
#define BLOCKTYPE_STAIRS_BOTTOM_INNER_N_E 88u
#define BLOCKTYPE_STAIRS_BOTTOM_INNER_S_W 89u
#define BLOCKTYPE_STAIRS_BOTTOM_INNER_S_E 90u
#define BLOCKTYPE_STAIRS_BOTTOM_OUTER_N_W 91u
#define BLOCKTYPE_STAIRS_BOTTOM_OUTER_N_E 92u
#define BLOCKTYPE_STAIRS_BOTTOM_OUTER_S_W 93u
#define BLOCKTYPE_STAIRS_BOTTOM_OUTER_S_E 94u
#define BLOCKTYPE_STAIRS_TOP_N 95u
#define BLOCKTYPE_STAIRS_TOP_E 96u
#define BLOCKTYPE_STAIRS_TOP_S 97u
#define BLOCKTYPE_STAIRS_TOP_W 98u
#define BLOCKTYPE_STAIRS_TOP_INNER_N_W 99u
#define BLOCKTYPE_STAIRS_TOP_INNER_N_E 100u
#define BLOCKTYPE_STAIRS_TOP_INNER_S_W 101u
#define BLOCKTYPE_STAIRS_TOP_INNER_S_E 102u
#define BLOCKTYPE_STAIRS_TOP_OUTER_N_W 103u
#define BLOCKTYPE_STAIRS_TOP_OUTER_N_E 104u
#define BLOCKTYPE_STAIRS_TOP_OUTER_S_W 105u
#define BLOCKTYPE_STAIRS_TOP_OUTER_S_E 106u

#define BLOCKTYPE_FENCE_POST 107u
#define BLOCKTYPE_FENCE_N 108u
#define BLOCKTYPE_FENCE_E 109u
#define BLOCKTYPE_FENCE_S 110u
#define BLOCKTYPE_FENCE_W 111u
#define BLOCKTYPE_FENCE_N_S 112u
#define BLOCKTYPE_FENCE_W_E 113u
#define BLOCKTYPE_FENCE_N_W 114u
#define BLOCKTYPE_FENCE_N_E 115u
#define BLOCKTYPE_FENCE_S_W 116u
#define BLOCKTYPE_FENCE_S_E 117u
#define BLOCKTYPE_FENCE_W_N_E 118u
#define BLOCKTYPE_FENCE_W_S_E 119u
#define BLOCKTYPE_FENCE_N_W_S 120u
#define BLOCKTYPE_FENCE_N_E_S 121u
#define BLOCKTYPE_FENCE_ALL 122u

#define BLOCKTYPE_FENCE_GATE_CLOSED_N_S 123u
#define BLOCKTYPE_FENCE_GATE_CLOSED_W_E 124u

#define BLOCKTYPE_WALL_POST 125u
#define BLOCKTYPE_WALL_POST_LOW_N 126u
#define BLOCKTYPE_WALL_POST_LOW_E 127u
#define BLOCKTYPE_WALL_POST_LOW_S 128u
#define BLOCKTYPE_WALL_POST_LOW_W 129u
#define BLOCKTYPE_WALL_POST_LOW_N_S 130u
#define BLOCKTYPE_WALL_POST_LOW_W_E 131u
#define BLOCKTYPE_WALL_POST_LOW_N_W 132u
#define BLOCKTYPE_WALL_POST_LOW_N_E 133u
#define BLOCKTYPE_WALL_POST_LOW_S_W 134u
#define BLOCKTYPE_WALL_POST_LOW_S_E 135u
#define BLOCKTYPE_WALL_POST_LOW_N_W_S 136u
#define BLOCKTYPE_WALL_POST_LOW_N_E_S 137u
#define BLOCKTYPE_WALL_POST_LOW_W_N_E 138u
#define BLOCKTYPE_WALL_POST_LOW_W_S_E 139u
#define BLOCKTYPE_WALL_POST_LOW_ALL 140u
#define BLOCKTYPE_WALL_POST_TALL_N 141u
#define BLOCKTYPE_WALL_POST_TALL_E 142u
#define BLOCKTYPE_WALL_POST_TALL_S 143u
#define BLOCKTYPE_WALL_POST_TALL_W 144u
#define BLOCKTYPE_WALL_POST_TALL_N_S 145u
#define BLOCKTYPE_WALL_POST_TALL_W_E 146u
#define BLOCKTYPE_WALL_POST_TALL_N_W 147u
#define BLOCKTYPE_WALL_POST_TALL_N_E 148u
#define BLOCKTYPE_WALL_POST_TALL_S_W 149u
#define BLOCKTYPE_WALL_POST_TALL_S_E 150u
#define BLOCKTYPE_WALL_POST_TALL_N_W_S 151u
#define BLOCKTYPE_WALL_POST_TALL_N_E_S 152u
#define BLOCKTYPE_WALL_POST_TALL_W_N_E 153u
#define BLOCKTYPE_WALL_POST_TALL_W_S_E 154u
#define BLOCKTYPE_WALL_POST_TALL_ALL 155u
#define BLOCKTYPE_WALL_LOW_N_S 156u
#define BLOCKTYPE_WALL_LOW_W_E 157u
#define BLOCKTYPE_WALL_TALL_N_S 158u
#define BLOCKTYPE_WALL_TALL_W_E 159u

#define BLOCKTYPE_CHORUS_DOWN 160u
#define BLOCKTYPE_CHORUS_UP_DOWN 161u
#define BLOCKTYPE_CHORUS_OTHER 162u

#define BLOCKTYPE_AMETHYST 163u
#define BLOCKTYPE_DIAMOND 164u
#define BLOCKTYPE_EMERALD 165u
#define BLOCKTYPE_HONEY 166u
#define BLOCKTYPE_SLIME 167u
#define BLOCKTYPE_SNOW 168u
#define BLOCKTYPE_STAINED_GLASS_BLACK 169u
#define BLOCKTYPE_STAINED_GLASS_BLUE 170u
#define BLOCKTYPE_STAINED_GLASS_BROWN 171u
#define BLOCKTYPE_STAINED_GLASS_CYAN 172u
#define BLOCKTYPE_STAINED_GLASS_GRAY 173u
#define BLOCKTYPE_STAINED_GLASS_GREEN 174u
#define BLOCKTYPE_STAINED_GLASS_LIGHT_BLUE 175u
#define BLOCKTYPE_STAINED_GLASS_LIGHT_GRAY 176u
#define BLOCKTYPE_STAINED_GLASS_LIME 177u
#define BLOCKTYPE_STAINED_GLASS_MAGENTA 178u
#define BLOCKTYPE_STAINED_GLASS_ORANGE 179u
#define BLOCKTYPE_STAINED_GLASS_PINK 180u
#define BLOCKTYPE_STAINED_GLASS_PURPLE 181u
#define BLOCKTYPE_STAINED_GLASS_RED 182u
#define BLOCKTYPE_STAINED_GLASS_WHITE 183u
#define BLOCKTYPE_STAINED_GLASS_YELLOW 184u


#if DYN_LIGHT_MODE == DYN_LIGHT_TRACED
    bool IsDynLightSolidBlock(const in int blockId) {
        bool result = false;
        if (blockId < 1 || blockId >= 1000) result = true;
        if (blockId >= 400 && blockId < 700) result = true;

        if (blockId >= BLOCK_BLAST_FURNACE_LIT_N && blockId <= BLOCK_BLAST_FURNACE_LIT_W) result = true;
        if (blockId >= BLOCK_FURNACE_LIT_N && blockId <= BLOCK_FURNACE_LIT_W) result = true;
        if (blockId >= BLOCK_JACK_O_LANTERN_N && blockId <= BLOCK_JACK_O_LANTERN_W) result = true;
        if (blockId >= BLOCK_SMOKER_LIT_N && blockId <= BLOCK_SMOKER_LIT_W) result = true;

        if (blockId == BLOCK_CANDLE_CAKE_LIT) result = true;
        if (blockId == BLOCK_FROGLIGHT_OCHRE) result = true;
        if (blockId == BLOCK_FROGLIGHT_PEARLESCENT) result = true;
        if (blockId == BLOCK_FROGLIGHT_VERDANT) result = true;
        if (blockId == BLOCK_GLOWSTONE) result = true;
        if (blockId == BLOCK_LANTERN_CEIL || blockId == BLOCK_SOUL_LANTERN_CEIL) result = true;
        if (blockId == BLOCK_LANTERN_FLOOR || blockId == BLOCK_SOUL_LANTERN_FLOOR) result = true;
        if (blockId == BLOCK_LAVA_CAULDRON) result = true;
        if (blockId == BLOCK_REDSTONE_LAMP_LIT) result = true;
        if (blockId == BLOCK_SCULK_CATALYST) result = true;
        if (blockId == BLOCK_SEA_LANTERN) result = true;
        if (blockId == BLOCK_SHROOMLIGHT) result = true;

        if (blockId == BLOCK_CONCRETE_BLUE || blockId == BLOCK_CONCRETE_GREEN || blockId == BLOCK_CONCRETE_RED) result = true;

        if (blockId == BLOCK_DIAMOND || blockId == BLOCK_EMERALD || blockId == BLOCK_LAPIS || blockId == BLOCK_REDSTONE) result = true;

        return result;
    }
#endif

#if defined RENDER_SHADOW && DYN_LIGHT_MODE == DYN_LIGHT_TRACED
    uint GetBlockType(const in int blockId) {
        uint blockType = BLOCKTYPE_SOLID;
        if (blockId < 1) return blockType;

        switch (blockId) {
            case BLOCK_ANVIL_N_S:
                blockType = BLOCKTYPE_ANVIL_N_S;
                break;
            case BLOCK_ANVIL_W_E:
                blockType = BLOCKTYPE_ANVIL_W_E;
                break;

            case BLOCK_BELL_FLOOR_N_S:
            case BLOCK_BELL_WALL_N:
            case BLOCK_BELL_WALL_S:
            case BLOCK_BELL_WALL_N_S:
            case BLOCK_BELL_CEILING:
                blockType = BLOCKTYPE_BELL_FLOOR_N_S;
                break;
            case BLOCK_BELL_FLOOR_W_E:
            case BLOCK_BELL_WALL_W:
            case BLOCK_BELL_WALL_E:
            case BLOCK_BELL_WALL_W_E:
                blockType = BLOCKTYPE_BELL_FLOOR_W_E;
                break;

            case BLOCK_CACTUS:
                blockType = BLOCKTYPE_CACTUS;
                break;

            case BLOCK_CAKE:
                blockType = BLOCKTYPE_CAKE;
                break;

            case BLOCK_CAMPFIRE_N_S:
                blockType = BLOCKTYPE_CAMPFIRE_N_S;
                break;
            case BLOCK_CAMPFIRE_W_E:
                blockType = BLOCKTYPE_CAMPFIRE_W_E;
                break;

            case BLOCK_CANDLE_CAKE:
            case BLOCK_CANDLE_CAKE_LIT:
                blockType = BLOCKTYPE_CANDLE_CAKE;
                break;

            case BLOCK_CARPET:
                blockType = BLOCKTYPE_CARPET;
                break;

            case BLOCK_CAULDRON:
            case BLOCK_LAVA_CAULDRON:
                blockType = BLOCKTYPE_CAULDRON;
                break;

            case BLOCK_COMPARATOR:
                blockType = BLOCKTYPE_LAYERS_2;
                break;

            case BLOCK_DAYLIGHT_DETECTOR:
                blockType = BLOCKTYPE_LAYERS_6;
                break;

            case BLOCK_ENCHANTING_TABLE:
                blockType = BLOCKTYPE_LAYERS_12;
                break;
            case BLOCK_END_PORTAL_FRAME:
                blockType = BLOCKTYPE_END_PORTAL_FRAME;
                break;
            case BLOCK_FLOWER_POT:
            case BLOCK_POTTED_PLANT:
                blockType = BLOCKTYPE_FLOWER_POT;
                break;
            case BLOCK_GRINDSTONE_FLOOR_N_S:
                blockType = BLOCKTYPE_GRINDSTONE_FLOOR_N_S;
                break;
            case BLOCK_GRINDSTONE_FLOOR_W_E:
                blockType = BLOCKTYPE_GRINDSTONE_FLOOR_W_E;
                break;
            case BLOCK_GRINDSTONE_WALL_N_S:
                blockType = BLOCKTYPE_GRINDSTONE_WALL_N_S;
                break;
            case BLOCK_GRINDSTONE_WALL_W_E:
                blockType = BLOCKTYPE_GRINDSTONE_WALL_W_E;
                break;
            case BLOCK_HOPPER_DOWN:
                blockType = BLOCKTYPE_HOPPER_DOWN;
                break;
            case BLOCK_HOPPER_N:
                blockType = BLOCKTYPE_HOPPER_N;
                break;
            case BLOCK_HOPPER_E:
                blockType = BLOCKTYPE_HOPPER_E;
                break;
            case BLOCK_HOPPER_S:
                blockType = BLOCKTYPE_HOPPER_S;
                break;
            case BLOCK_HOPPER_W:
                blockType = BLOCKTYPE_HOPPER_W;
                break;
            case BLOCK_LANTERN_CEIL:
            case BLOCK_SOUL_LANTERN_CEIL:
                blockType = BLOCKTYPE_LANTERN_CEIL;
                break;
            case BLOCK_LANTERN_FLOOR:
            case BLOCK_SOUL_LANTERN_FLOOR:
                blockType = BLOCKTYPE_LANTERN_FLOOR;
                break;
            case BLOCK_LECTERN:
                blockType = BLOCKTYPE_LECTERN;
                break;
            case BLOCK_LIGHTNING_ROD_N:
                blockType = BLOCKTYPE_LIGHTNING_ROD_N;
                break;
            case BLOCK_LIGHTNING_ROD_E:
                blockType = BLOCKTYPE_LIGHTNING_ROD_E;
                break;
            case BLOCK_LIGHTNING_ROD_S:
                blockType = BLOCKTYPE_LIGHTNING_ROD_S;
                break;
            case BLOCK_LIGHTNING_ROD_W:
                blockType = BLOCKTYPE_LIGHTNING_ROD_W;
                break;
            case BLOCK_LIGHTNING_ROD_UP:
                blockType = BLOCKTYPE_LIGHTNING_ROD_UP;
                break;
            case BLOCK_LIGHTNING_ROD_DOWN:
                blockType = BLOCKTYPE_LIGHTNING_ROD_DOWN;
                break;
            case BLOCK_PATHWAY:
                blockType = BLOCKTYPE_PATHWAY;
                break;
            case BLOCK_PISTON_EXTENDED_N:
                blockType = BLOCKTYPE_PISTON_EXTENDED_N;
                break;
            case BLOCK_PISTON_EXTENDED_E:
                blockType = BLOCKTYPE_PISTON_EXTENDED_E;
                break;
            case BLOCK_PISTON_EXTENDED_S:
                blockType = BLOCKTYPE_PISTON_EXTENDED_S;
                break;
            case BLOCK_PISTON_EXTENDED_W:
                blockType = BLOCKTYPE_PISTON_EXTENDED_W;
                break;
            case BLOCK_PISTON_EXTENDED_UP:
                blockType = BLOCKTYPE_PISTON_EXTENDED_UP;
                break;
            case BLOCK_PISTON_EXTENDED_DOWN:
                blockType = BLOCKTYPE_PISTON_EXTENDED_DOWN;
                break;
            case BLOCK_PISTON_HEAD_N:
                blockType = BLOCKTYPE_PISTON_HEAD_N;
                break;
            case BLOCK_PISTON_HEAD_E:
                blockType = BLOCKTYPE_PISTON_HEAD_E;
                break;
            case BLOCK_PISTON_HEAD_S:
                blockType = BLOCKTYPE_PISTON_HEAD_S;
                break;
            case BLOCK_PISTON_HEAD_W:
                blockType = BLOCKTYPE_PISTON_HEAD_W;
                break;
            case BLOCK_PISTON_HEAD_UP:
                blockType = BLOCKTYPE_PISTON_HEAD_UP;
                break;
            case BLOCK_PISTON_HEAD_DOWN:
                blockType = BLOCKTYPE_PISTON_HEAD_DOWN;
                break;
            case BLOCK_PRESSURE_PLATE:
                blockType = BLOCKTYPE_PRESSURE_PLATE;
                break;
            case BLOCK_REPEATER:
                blockType = BLOCKTYPE_LAYERS_2;
                break;
            case BLOCK_STONECUTTER:
                blockType = BLOCKTYPE_STONECUTTER;
                break;

            case BLOCK_SNOW_LAYERS_1:
                blockType = BLOCKTYPE_LAYERS_2;
                break;
            case BLOCK_SNOW_LAYERS_2:
                blockType = BLOCKTYPE_LAYERS_4;
                break;
            case BLOCK_SNOW_LAYERS_3:
                blockType = BLOCKTYPE_LAYERS_6;
                break;
            case BLOCK_SNOW_LAYERS_4:
                blockType = BLOCKTYPE_LAYERS_8;
                break;
            case BLOCK_SNOW_LAYERS_5:
                blockType = BLOCKTYPE_LAYERS_10;
                break;
            case BLOCK_SNOW_LAYERS_6:
                blockType = BLOCKTYPE_LAYERS_12;
                break;
            case BLOCK_SNOW_LAYERS_7:
                blockType = BLOCKTYPE_LAYERS_14;
                break;
        }
                
        switch (blockId) {
            case BLOCK_BUTTON_FLOOR_N_S:
                blockType = BLOCKTYPE_BUTTON_FLOOR_N_S;
                break;
            case BLOCK_BUTTON_FLOOR_W_E:
                blockType = BLOCKTYPE_BUTTON_FLOOR_W_E;
                break;
            case BLOCK_BUTTON_CEILING_N_S:
                blockType = BLOCKTYPE_BUTTON_CEILING_N_S;
                break;
            case BLOCK_BUTTON_CEILING_W_E:
                blockType = BLOCKTYPE_BUTTON_CEILING_W_E;
                break;
            case BLOCK_BUTTON_WALL_N:
                blockType = BLOCKTYPE_BUTTON_WALL_N;
                break;
            case BLOCK_BUTTON_WALL_E:
                blockType = BLOCKTYPE_BUTTON_WALL_E;
                break;
            case BLOCK_BUTTON_WALL_S:
                blockType = BLOCKTYPE_BUTTON_WALL_S;
                break;
            case BLOCK_BUTTON_WALL_W:
                blockType = BLOCKTYPE_BUTTON_WALL_W;
                break;
                
            case BLOCK_CHORUS_DOWN:
                blockType = BLOCKTYPE_CHORUS_DOWN;
                break;
            case BLOCK_CHORUS_UP_DOWN:
                blockType = BLOCKTYPE_CHORUS_UP_DOWN;
                break;
            case BLOCK_CHORUS_OTHER:
                blockType = BLOCKTYPE_CHORUS_OTHER;
                break;

            case BLOCK_DOOR_N:
                blockType = BLOCKTYPE_DOOR_N;
                break;
            case BLOCK_DOOR_E:
                blockType = BLOCKTYPE_DOOR_E;
                break;
            case BLOCK_DOOR_S:
                blockType = BLOCKTYPE_DOOR_S;
                break;
            case BLOCK_DOOR_W:
                blockType = BLOCKTYPE_DOOR_W;
                break;

            case BLOCK_LEVER_FLOOR_N_S:
                blockType = BLOCKTYPE_LEVER_FLOOR_N_S;
                break;
            case BLOCK_LEVER_FLOOR_W_E:
                blockType = BLOCKTYPE_LEVER_FLOOR_W_E;
                break;
            case BLOCK_LEVER_CEILING_N_S:
                blockType = BLOCKTYPE_LEVER_CEILING_N_S;
                break;
            case BLOCK_LEVER_CEILING_W_E:
                blockType = BLOCKTYPE_LEVER_CEILING_W_E;
                break;
            case BLOCK_LEVER_WALL_N:
                blockType = BLOCKTYPE_LEVER_WALL_N;
                break;
            case BLOCK_LEVER_WALL_E:
                blockType = BLOCKTYPE_LEVER_WALL_E;
                break;
            case BLOCK_LEVER_WALL_S:
                blockType = BLOCKTYPE_LEVER_WALL_S;
                break;
            case BLOCK_LEVER_WALL_W:
                blockType = BLOCKTYPE_LEVER_WALL_W;
                break;

            case BLOCK_TRAPDOOR_BOTTOM:
                blockType = BLOCKTYPE_TRAPDOOR_BOTTOM;
                break;
            case BLOCK_TRAPDOOR_TOP:
                blockType = BLOCKTYPE_TRAPDOOR_TOP;
                break;
            case BLOCK_TRAPDOOR_N:
                blockType = BLOCKTYPE_TRAPDOOR_N;
                break;
            case BLOCK_TRAPDOOR_E:
                blockType = BLOCKTYPE_TRAPDOOR_E;
                break;
            case BLOCK_TRAPDOOR_S:
                blockType = BLOCKTYPE_TRAPDOOR_S;
                break;
            case BLOCK_TRAPDOOR_W:
                blockType = BLOCKTYPE_TRAPDOOR_W;
                break;

            case BLOCK_TRIPWIRE_HOOK_N:
                blockType = BLOCKTYPE_TRIPWIRE_HOOK_N;
                break;
            case BLOCK_TRIPWIRE_HOOK_E:
                blockType = BLOCKTYPE_TRIPWIRE_HOOK_E;
                break;
            case BLOCK_TRIPWIRE_HOOK_S:
                blockType = BLOCKTYPE_TRIPWIRE_HOOK_S;
                break;
            case BLOCK_TRIPWIRE_HOOK_W:
                blockType = BLOCKTYPE_TRIPWIRE_HOOK_W;
                break;

            case BLOCK_SLABS_BOTTOM:
            case BLOCK_SCULK_SENSOR:
            case BLOCK_SCULK_SHRIEKER:
                blockType = BLOCKTYPE_LAYERS_8;
                break;
            case BLOCK_SLABS_TOP:
                blockType = BLOCKTYPE_SLAB_TOP;
                break;

            case BLOCK_STAIRS_BOTTOM_N:
                blockType = BLOCKTYPE_STAIRS_BOTTOM_N;
                break;
            case BLOCK_STAIRS_BOTTOM_E:
                blockType = BLOCKTYPE_STAIRS_BOTTOM_E;
                break;
            case BLOCK_STAIRS_BOTTOM_S:
                blockType = BLOCKTYPE_STAIRS_BOTTOM_S;
                break;
            case BLOCK_STAIRS_BOTTOM_W:
                blockType = BLOCKTYPE_STAIRS_BOTTOM_W;
                break;
            case BLOCK_STAIRS_BOTTOM_INNER_N_W:
                blockType = BLOCKTYPE_STAIRS_BOTTOM_INNER_N_W;
                break;
            case BLOCK_STAIRS_BOTTOM_INNER_N_E:
                blockType = BLOCKTYPE_STAIRS_BOTTOM_INNER_N_E;
                break;
            case BLOCK_STAIRS_BOTTOM_INNER_S_W:
                blockType = BLOCKTYPE_STAIRS_BOTTOM_INNER_S_W;
                break;
            case BLOCK_STAIRS_BOTTOM_INNER_S_E:
                blockType = BLOCKTYPE_STAIRS_BOTTOM_INNER_S_E;
                break;
            case BLOCK_STAIRS_BOTTOM_OUTER_N_W:
                blockType = BLOCKTYPE_STAIRS_BOTTOM_OUTER_N_W;
                break;
            case BLOCK_STAIRS_BOTTOM_OUTER_N_E:
                blockType = BLOCKTYPE_STAIRS_BOTTOM_OUTER_N_E;
                break;
            case BLOCK_STAIRS_BOTTOM_OUTER_S_W:
                blockType = BLOCKTYPE_STAIRS_BOTTOM_OUTER_S_W;
                break;
            case BLOCK_STAIRS_BOTTOM_OUTER_S_E:
                blockType = BLOCKTYPE_STAIRS_BOTTOM_OUTER_S_E;
                break;
            case BLOCK_STAIRS_TOP_N:
                blockType = BLOCKTYPE_STAIRS_TOP_N;
                break;
            case BLOCK_STAIRS_TOP_E:
                blockType = BLOCKTYPE_STAIRS_TOP_E;
                break;
            case BLOCK_STAIRS_TOP_S:
                blockType = BLOCKTYPE_STAIRS_TOP_S;
                break;
            case BLOCK_STAIRS_TOP_W:
                blockType = BLOCKTYPE_STAIRS_TOP_W;
                break;
            case BLOCK_STAIRS_TOP_INNER_N_W:
                blockType = BLOCKTYPE_STAIRS_TOP_INNER_N_W;
                break;
            case BLOCK_STAIRS_TOP_INNER_N_E:
                blockType = BLOCKTYPE_STAIRS_TOP_INNER_N_E;
                break;
            case BLOCK_STAIRS_TOP_INNER_S_W:
                blockType = BLOCKTYPE_STAIRS_TOP_INNER_S_W;
                break;
            case BLOCK_STAIRS_TOP_INNER_S_E:
                blockType = BLOCKTYPE_STAIRS_TOP_INNER_S_E;
                break;
            case BLOCK_STAIRS_TOP_OUTER_N_W:
                blockType = BLOCKTYPE_STAIRS_TOP_OUTER_N_W;
                break;
            case BLOCK_STAIRS_TOP_OUTER_N_E:
                blockType = BLOCKTYPE_STAIRS_TOP_OUTER_N_E;
                break;
            case BLOCK_STAIRS_TOP_OUTER_S_W:
                blockType = BLOCKTYPE_STAIRS_TOP_OUTER_S_W;
                break;
            case BLOCK_STAIRS_TOP_OUTER_S_E:
                blockType = BLOCKTYPE_STAIRS_TOP_OUTER_S_E;
                break;
        }

        switch (blockId) {
            case BLOCK_FENCE_POST:
                blockType = BLOCKTYPE_FENCE_POST;
                break;
            case BLOCK_FENCE_N:
                blockType = BLOCKTYPE_FENCE_N;
                break;
            case BLOCK_FENCE_E:
                blockType = BLOCKTYPE_FENCE_E;
                break;
            case BLOCK_FENCE_S:
                blockType = BLOCKTYPE_FENCE_S;
                break;
            case BLOCK_FENCE_W:
                blockType = BLOCKTYPE_FENCE_W;
                break;
            case BLOCK_FENCE_N_S:
                blockType = BLOCKTYPE_FENCE_N_S;
                break;
            case BLOCK_FENCE_W_E:
                blockType = BLOCKTYPE_FENCE_W_E;
                break;
            case BLOCK_FENCE_N_W:
                blockType = BLOCKTYPE_FENCE_N_W;
                break;
            case BLOCK_FENCE_N_E:
                blockType = BLOCKTYPE_FENCE_N_E;
                break;
            case BLOCK_FENCE_S_W:
                blockType = BLOCKTYPE_FENCE_S_W;
                break;
            case BLOCK_FENCE_S_E:
                blockType = BLOCKTYPE_FENCE_S_E;
                break;
            case BLOCK_FENCE_W_N_E:
                blockType = BLOCKTYPE_FENCE_W_N_E;
                break;
            case BLOCK_FENCE_W_S_E:
                blockType = BLOCKTYPE_FENCE_W_S_E;
                break;
            case BLOCK_FENCE_N_W_S:
                blockType = BLOCKTYPE_FENCE_N_W_S;
                break;
            case BLOCK_FENCE_N_E_S:
                blockType = BLOCKTYPE_FENCE_N_E_S;
                break;
            case BLOCK_FENCE_ALL:
                blockType = BLOCKTYPE_FENCE_ALL;
                break;

            case BLOCK_FENCE_GATE_CLOSED_N_S:
                blockType = BLOCKTYPE_FENCE_GATE_CLOSED_N_S;
                break;
            case BLOCK_FENCE_GATE_CLOSED_W_E:
                blockType = BLOCKTYPE_FENCE_GATE_CLOSED_W_E;
                break;
        }

        switch (blockId) {
            case BLOCK_WALL_POST:
                blockType = BLOCKTYPE_WALL_POST;
                break;
            case BLOCK_WALL_POST_LOW_N:
                blockType = BLOCKTYPE_WALL_POST_LOW_N;
                break;
            case BLOCK_WALL_POST_LOW_E:
                blockType = BLOCKTYPE_WALL_POST_LOW_E;
                break;
            case BLOCK_WALL_POST_LOW_S:
                blockType = BLOCKTYPE_WALL_POST_LOW_S;
                break;
            case BLOCK_WALL_POST_LOW_W:
                blockType = BLOCKTYPE_WALL_POST_LOW_W;
                break;
            case BLOCK_WALL_POST_LOW_N_S:
                blockType = BLOCKTYPE_WALL_POST_LOW_N_S;
                break;
            case BLOCK_WALL_POST_LOW_W_E:
                blockType = BLOCKTYPE_WALL_POST_LOW_W_E;
                break;
            case BLOCK_WALL_POST_LOW_N_W:
                blockType = BLOCKTYPE_WALL_POST_LOW_N_W;
                break;
            case BLOCK_WALL_POST_LOW_N_E:
                blockType = BLOCKTYPE_WALL_POST_LOW_N_E;
                break;
            case BLOCK_WALL_POST_LOW_S_W:
                blockType = BLOCKTYPE_WALL_POST_LOW_S_W;
                break;
            case BLOCK_WALL_POST_LOW_S_E:
                blockType = BLOCKTYPE_WALL_POST_LOW_S_E;
                break;
            case BLOCK_WALL_POST_LOW_N_W_S:
                blockType = BLOCKTYPE_WALL_POST_LOW_N_W_S;
                break;
            case BLOCK_WALL_POST_LOW_N_E_S:
                blockType = BLOCKTYPE_WALL_POST_LOW_N_E_S;
                break;
            case BLOCK_WALL_POST_LOW_W_N_E:
                blockType = BLOCKTYPE_WALL_POST_LOW_W_N_E;
                break;
            case BLOCK_WALL_POST_LOW_W_S_E:
                blockType = BLOCKTYPE_WALL_POST_LOW_W_S_E;
                break;
            case BLOCK_WALL_POST_LOW_ALL:
                blockType = BLOCKTYPE_WALL_POST_LOW_ALL;
                break;
            case BLOCK_WALL_POST_TALL_N:
                blockType = BLOCKTYPE_WALL_POST_TALL_N;
                break;
            case BLOCK_WALL_POST_TALL_E:
                blockType = BLOCKTYPE_WALL_POST_TALL_E;
                break;
            case BLOCK_WALL_POST_TALL_S:
                blockType = BLOCKTYPE_WALL_POST_TALL_S;
                break;
            case BLOCK_WALL_POST_TALL_W:
                blockType = BLOCKTYPE_WALL_POST_TALL_W;
                break;
            case BLOCK_WALL_POST_TALL_N_S:
                blockType = BLOCKTYPE_WALL_POST_TALL_N_S;
                break;
            case BLOCK_WALL_POST_TALL_W_E:
                blockType = BLOCKTYPE_WALL_POST_TALL_W_E;
                break;
            case BLOCK_WALL_POST_TALL_N_W:
                blockType = BLOCKTYPE_WALL_POST_TALL_N_W;
                break;
            case BLOCK_WALL_POST_TALL_N_E:
                blockType = BLOCKTYPE_WALL_POST_TALL_N_E;
                break;
            case BLOCK_WALL_POST_TALL_S_W:
                blockType = BLOCKTYPE_WALL_POST_TALL_S_W;
                break;
            case BLOCK_WALL_POST_TALL_S_E:
                blockType = BLOCKTYPE_WALL_POST_TALL_S_E;
                break;
            case BLOCK_WALL_POST_TALL_N_W_S:
                blockType = BLOCKTYPE_WALL_POST_TALL_N_W_S;
                break;
            case BLOCK_WALL_POST_TALL_N_E_S:
                blockType = BLOCKTYPE_WALL_POST_TALL_N_E_S;
                break;
            case BLOCK_WALL_POST_TALL_W_N_E:
                blockType = BLOCKTYPE_WALL_POST_TALL_W_N_E;
                break;
            case BLOCK_WALL_POST_TALL_W_S_E:
                blockType = BLOCKTYPE_WALL_POST_TALL_W_S_E;
                break;
            case BLOCK_WALL_POST_TALL_ALL:
                blockType = BLOCKTYPE_WALL_POST_TALL_ALL;
                break;
            case BLOCK_WALL_LOW_N_S:
                blockType = BLOCKTYPE_WALL_LOW_N_S;
                break;
            case BLOCK_WALL_LOW_W_E:
                blockType = BLOCKTYPE_WALL_LOW_W_E;
                break;
            case BLOCK_WALL_TALL_N_S:
                blockType = BLOCKTYPE_WALL_TALL_N_S;
                break;
            case BLOCK_WALL_TALL_W_E:
                blockType = BLOCKTYPE_WALL_TALL_W_E;
                break;
        }

        switch (blockId) {
            case BLOCK_AMETHYST:
                blockType = BLOCKTYPE_AMETHYST;
                break;
            case BLOCK_DIAMOND:
                blockType = BLOCKTYPE_DIAMOND;
                break;
            case BLOCK_EMERALD:
                blockType = BLOCKTYPE_EMERALD;
                break;
            case BLOCK_HONEY:
                blockType = BLOCKTYPE_HONEY;
                break;
            case BLOCK_SLIME:
                blockType = BLOCKTYPE_SLIME;
                break;
            case BLOCK_SNOW:
                blockType = BLOCKTYPE_SNOW;
                break;
            case BLOCK_STAINED_GLASS_BLACK:
                blockType = BLOCKTYPE_STAINED_GLASS_BLACK;
                break;
            case BLOCK_STAINED_GLASS_BLUE:
                blockType = BLOCKTYPE_STAINED_GLASS_BLUE;
                break;
            case BLOCK_STAINED_GLASS_BROWN:
                blockType = BLOCKTYPE_STAINED_GLASS_BROWN;
                break;
            case BLOCK_STAINED_GLASS_CYAN:
                blockType = BLOCKTYPE_STAINED_GLASS_CYAN;
                break;
            case BLOCK_STAINED_GLASS_GRAY:
                blockType = BLOCKTYPE_STAINED_GLASS_GRAY;
                break;
            case BLOCK_STAINED_GLASS_GREEN:
                blockType = BLOCKTYPE_STAINED_GLASS_GREEN;
                break;
            case BLOCK_STAINED_GLASS_LIGHT_BLUE:
                blockType = BLOCKTYPE_STAINED_GLASS_LIGHT_BLUE;
                break;
            case BLOCK_STAINED_GLASS_LIGHT_GRAY:
                blockType = BLOCKTYPE_STAINED_GLASS_LIGHT_GRAY;
                break;
            case BLOCK_STAINED_GLASS_LIME:
                blockType = BLOCKTYPE_STAINED_GLASS_LIME;
                break;
            case BLOCK_STAINED_GLASS_MAGENTA:
                blockType = BLOCKTYPE_STAINED_GLASS_MAGENTA;
                break;
            case BLOCK_STAINED_GLASS_ORANGE:
                blockType = BLOCKTYPE_STAINED_GLASS_ORANGE;
                break;
            case BLOCK_STAINED_GLASS_PINK:
                blockType = BLOCKTYPE_STAINED_GLASS_PINK;
                break;
            case BLOCK_STAINED_GLASS_PURPLE:
                blockType = BLOCKTYPE_STAINED_GLASS_PURPLE;
                break;
            case BLOCK_STAINED_GLASS_RED:
                blockType = BLOCKTYPE_STAINED_GLASS_RED;
                break;
            case BLOCK_STAINED_GLASS_WHITE:
            case BLOCK_LEAVES:
                blockType = BLOCKTYPE_STAINED_GLASS_WHITE;
                break;
            case BLOCK_STAINED_GLASS_YELLOW:
                blockType = BLOCKTYPE_STAINED_GLASS_YELLOW;
                break;
        }

        return blockType;
    }
#endif
