import { world, BlockPermutation } from '@minecraft/server';
export const items_list = {
    "ph_furn:short_curtain_yellow_item": {
        block: "ph_furn:short_curtain_yellow"
    },
    "ph_furn:short_curtain_white_item": {
        block: "ph_furn:short_curtain_white"
    },
    "ph_furn:short_curtain_red_item": {
        block: "ph_furn:short_curtain_red"
    },
    "ph_furn:short_curtain_purple_item": {
        block: "ph_furn:short_curtain_purple"
    },
    "ph_furn:short_curtain_green_item": {
        block: "ph_furn:short_curtain_green"
    },
    "ph_furn:short_curtain_blue_item": {
        block: "ph_furn:short_curtain_blue"
    },
    "ph_furn:short_curtain_black_item": {
        block: "ph_furn:short_curtain_black"
    },
    "ph_furn:large_curtain_yellow_item": {
        block: "ph_furn:large_curtain_yellow"
    },
    "ph_furn:large_curtain_white_item": {
        block: "ph_furn:large_curtain_white"
    },
    "ph_furn:large_curtain_red_item": {
        block: "ph_furn:large_curtain_red"
    },
    "ph_furn:large_curtain_purple_item": {
        block: "ph_furn:large_curtain_purple"
    },
    "ph_furn:large_curtain_green_item": {
        block: "ph_furn:large_curtain_green"
    },
    "ph_furn:large_curtain_blue_item": {
        block: "ph_furn:large_curtain_blue"
    },
    "ph_furn:large_curtain_black_item": {
        block: "ph_furn:large_curtain_black"
    },
    "ph_furn:arch_door_item": {
        block: "ph_furn:arch_door"
    },
    "ph_furn:black_door_item": {
        block: "ph_furn:black_door"
    },
    "ph_furn:black_door_triple_item": {
        block: "ph_furn:black_door_triple"
    },
    "ph_furn:black_glass_door_item": {
        block: "ph_furn:black_glass_door"
    },
    "ph_furn:blue_door_item": {
        block: "ph_furn:blue_door"
    },
    "ph_furn:blue_door_triple_item": {
        block: "ph_furn:blue_door_triple"
    },
    "ph_furn:brown_door_item": {
        block: "ph_furn:brown_door"
    },
    "ph_furn:brown_door_triple_item": {
        block: "ph_furn:brown_door_triple"
    },
    "ph_furn:contemporary_door_item": {
        block: "ph_furn:contemporary_door"
    },
    "ph_furn:elegant_door_item": {
        block: "ph_furn:elegant_door"
    },
    "ph_furn:glass_door_item": {
        block: "ph_furn:glass_door"
    },
    "ph_furn:green_door_item": {
        block: "ph_furn:green_door"
    },
    "ph_furn:green_door_triple_item": {
        block: "ph_furn:green_door_triple"
    },
    "ph_furn:panel_door_item": {
        block: "ph_furn:panel_door"
    },
    "ph_furn:purple_door_item": {
        block: "ph_furn:purple_door"
    },
    "ph_furn:purple_door_triple_item": {
        block: "ph_furn:purple_door_triple"
    },
    "ph_furn:red_door_item": {
        block: "ph_furn:red_door"
    },
    "ph_furn:red_door_triple_item": {
        block: "ph_furn:red_door_triple"
    },
    "ph_furn:reinforced_door_item": {
        block: "ph_furn:reinforced_door"
    },
    "ph_furn:rustic_door_item": {
        block: "ph_furn:rustic_door"
    },
    "ph_furn:white_door_item": {
        block: "ph_furn:white_door"
    },
    "ph_furn:white_door_triple_item": {
        block: "ph_furn:white_door_triple"
    },
    "ph_furn:white_glass_door_item": {
        block: "ph_furn:white_glass_door"
    },
    "ph_furn:yellow_door_item": {
        block: "ph_furn:yellow_door"
    },
    "ph_furn:yellow_door_triple_item": {
        block: "ph_furn:yellow_door_triple"
    },
};
function getPreciseRotation(playerYRotation) {
    if (playerYRotation < 0)
        playerYRotation += 360;
    const rotation = Math.round(playerYRotation / 45);
    return rotation !== 8 ? rotation : 0;
}


const PlayComponent = {
    onPlayerInteract(event) {
        const { block } = event;
        const blockOpenState = block.permutation.getState('ph_furn:open');
        let newOpenState = !blockOpenState;
        let location = block.location;

        let newPermutation = BlockPermutation.resolve(block.typeId, {
            ...block.permutation.getAllStates(),
            'ph_furn:open': newOpenState
        });
        block.setPermutation(newPermutation);
        if (newOpenState) {
            world.playSound("click_off.stone_pressure_plate", location);
        }
        else {
            world.playSound("click_on.stone_pressure_plate", location);
        }
    }
};
const FireComponent = {
    onPlayerInteract(event) {
        const { block } = event;
        const blockOpenState = block.permutation.getState('ph_furn:open');
        let newOpenState = !blockOpenState;
        let location = block.location;

        let newPermutation = BlockPermutation.resolve(block.typeId, {
            ...block.permutation.getAllStates(),
            'ph_furn:open': newOpenState
        });
        block.setPermutation(newPermutation);
        if (newOpenState) {
            world.playSound("fire.ignite", location);
        }
        else {
            world.playSound("fire.ignite", location);
        }
    },
    onTick(event) {
        const { block } = event;
        const location = block.location;
        const blockOpenState = block.permutation.getState('ph_furn:open');
        if (block.typeId.includes("cake") && blockOpenState == false) {
            block.dimension.spawnParticle('minecraft:candle_flame_particle', { x: location.x + 0.5, y: location.y + 0.8, z: location.z + 0.5 });
        }
        if (block.typeId.includes("small_candle") && blockOpenState == false) {
            block.dimension.spawnParticle('minecraft:candle_flame_particle', { x: location.x + 0.5, y: location.y + 0.8, z: location.z + 0.5 });
        }
        if (block.typeId.includes("large_candle") && blockOpenState == false) {
            block.dimension.spawnParticle('minecraft:candle_flame_particle', { x: location.x + 0.5, y: location.y + 1, z: location.z + 0.5 });
            block.dimension.spawnParticle('minecraft:candle_flame_particle', { x: location.x + 0.325, y: location.y + 0.9, z: location.z + 0.675 });
            block.dimension.spawnParticle('minecraft:candle_flame_particle', { x: location.x + 0.325, y: location.y + 0.9, z: location.z + 0.325 });
            block.dimension.spawnParticle('minecraft:candle_flame_particle', { x: location.x + 0.675, y: location.y + 0.9, z: location.z + 0.325 });
            block.dimension.spawnParticle('minecraft:candle_flame_particle', { x: location.x + 0.675, y: location.y + 0.9, z: location.z + 0.675 });
        }
    }
};
const LampComponent = {
    onPlayerInteract(event) {
        const { block } = event;
        const blockOpenState = block.permutation.getState('ph_furn:open');
        let newOpenState = !blockOpenState;
        let location = block.location;

        let newPermutation = BlockPermutation.resolve(block.typeId, {
            ...block.permutation.getAllStates(),
            'ph_furn:open': newOpenState
        });
        block.setPermutation(newPermutation);
        if (newOpenState) {
            world.playSound("click_off.stone_pressure_plate", location);
        }
        else {
            world.playSound("click_on.stone_pressure_plate", location);
        }
    }
};
const TreeComponent_4 = {
    beforeOnPlayerPlace(event) {
        const { block, player } = event;
        const playerYRotation = player.getRotation().y;
        const rotation = getPreciseRotation(playerYRotation);
        const equipment = player.getComponent("inventory").container;
        const selectedItem = equipment.getItem(player.selectedSlotIndex);
        let location = block.location;
        let cardinal = Math.round(rotation / 2 - 0.5) * 2;
        event.permutationToPlace = event.permutationToPlace.withState("ph_furn:rotation", cardinal);


        world.getDimension("overworld").runCommand(`/setblock ${location.x} ${location.y + 1} ${location.z} ${selectedItem?.typeId}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=2]`)
        world.getDimension("overworld").runCommand(`/setblock ${location.x} ${location.y + 2} ${location.z} ${selectedItem?.typeId}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=3]`)
        world.getDimension("overworld").runCommand(`/setblock ${location.x} ${location.y + 3} ${location.z} ${selectedItem?.typeId}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=4]`)

    },
    onTick(event) {
        const { block } = event;
        const location = block.location;
        const blockposState = block.permutation.getState('ph_furn:pos');
        if (world.getDimension("overworld").getBlock({ x: location.x, y: location.y - 1, z: location.z }).typeId == "minecraft:air" && blockposState == 4) {
            world.getDimension("overworld").runCommand(`setblock ${location.x} ${location.y} ${location.z} air`);
        }
        if (world.getDimension("overworld").getBlock({ x: location.x, y: location.y + 1, z: location.z }).typeId == "minecraft:air" && blockposState == 3) {
            world.getDimension("overworld").runCommand(`setblock ${location.x} ${location.y} ${location.z} air`);
        }
        if (world.getDimension("overworld").getBlock({ x: location.x, y: location.y - 1, z: location.z }).typeId == "minecraft:air" && blockposState == 3) {
            world.getDimension("overworld").runCommand(`setblock ${location.x} ${location.y} ${location.z} air`);
        }
        if (world.getDimension("overworld").getBlock({ x: location.x, y: location.y + 1, z: location.z }).typeId == "minecraft:air" && blockposState == 2) {
            world.getDimension("overworld").runCommand(`setblock ${location.x} ${location.y} ${location.z} air`);
        }
        if (world.getDimension("overworld").getBlock({ x: location.x, y: location.y - 1, z: location.z }).typeId == "minecraft:air" && blockposState == 2) {
            world.getDimension("overworld").runCommand(`setblock ${location.x} ${location.y} ${location.z} air`);
        }
        if (world.getDimension("overworld").getBlock({ x: location.x, y: location.y + 1, z: location.z }).typeId == "minecraft:air" && blockposState == 1) {
            world.getDimension("overworld").runCommand(`setblock ${location.x} ${location.y} ${location.z} air`);
        }
    }
};
const CurtainComponent_3 = {
    onPlayerInteract(event) {
        const { block } = event;
        const blockOpenState = block.permutation.getState('ph_furn:open');
        const blockposState = block.permutation.getState('ph_furn:pos');
        let newOpenState = !blockOpenState;
        let location = block.location;
        if (blockposState == 3) {
            let block_2 = world.getDimension("overworld").getBlock({ x: location.x, y: location.y - 1, z: location.z });
            let newLowerPermutation_2 = BlockPermutation.resolve(block.typeId, {
                ...block_2.permutation.getAllStates(),
                'ph_furn:open': newOpenState
            });
            block_2.setPermutation(newLowerPermutation_2);
            let block_1 = world.getDimension("overworld").getBlock({ x: location.x, y: location.y - 2, z: location.z });
            let newLowerPermutation_1 = BlockPermutation.resolve(block.typeId, {
                ...block_1.permutation.getAllStates(),
                'ph_furn:open': newOpenState
            });
            block_1.setPermutation(newLowerPermutation_1);
        }
        else if (blockposState == 2) {
            let lowerBlock = world.getDimension("overworld").getBlock({ x: location.x, y: location.y - 1, z: location.z });
            let newLowerPermutation = BlockPermutation.resolve(block.typeId, {
                ...lowerBlock.permutation.getAllStates(),
                'ph_furn:open': newOpenState
            });
            lowerBlock.setPermutation(newLowerPermutation);
            let posBlock = world.getDimension("overworld").getBlock({ x: location.x, y: location.y + 1, z: location.z });
            let newposPermutation = BlockPermutation.resolve(block.typeId, {
                ...posBlock.permutation.getAllStates(),
                'ph_furn:open': newOpenState
            });
            posBlock.setPermutation(newposPermutation);
        }
        else if (blockposState == 1) {
            let block_2 = world.getDimension("overworld").getBlock({ x: location.x, y: location.y + 1, z: location.z });
            let newposPermutation_2 = BlockPermutation.resolve(block.typeId, {
                ...block_2.permutation.getAllStates(),
                'ph_furn:open': newOpenState
            });
            block_2.setPermutation(newposPermutation_2);
            let block_3 = world.getDimension("overworld").getBlock({ x: location.x, y: location.y + 2, z: location.z });
            let newposPermutation_3 = BlockPermutation.resolve(block.typeId, {
                ...block_3.permutation.getAllStates(),
                'ph_furn:open': newOpenState
            });
            block_3.setPermutation(newposPermutation_3);
        }
        let newPermutation = BlockPermutation.resolve(block.typeId, {
            ...block.permutation.getAllStates(),
            'ph_furn:open': newOpenState
        });
        block.setPermutation(newPermutation);
        if (newOpenState) {
            world.playSound("ph_furn.curtain", location);
        }
        else {
            world.playSound("ph_furn.curtain", location);
        }
    },
    beforeOnPlayerPlace(event) {
        const { block, player } = event;
        const playerYRotation = player.getRotation().y;
        const rotation = getPreciseRotation(playerYRotation);
        const equipment = player.getComponent("inventory").container;
        const selectedItem = equipment.getItem(player.selectedSlotIndex);
        const item_id = items_list[selectedItem?.typeId];
        let location = block.location;
        let posBlockLocation = { x: location.x, y: location.y + 1, z: location.z };
        let location_x_1 = { x: location.x + 1, y: location.y, z: location.z };
        let location_x_01 = { x: location.x - 1, y: location.y, z: location.z };
        let location_z_1 = { x: location.x, y: location.y, z: location.z + 1 };
        let location_z_01 = { x: location.x, y: location.y, z: location.z - 1 };
        let cardinal = Math.round(rotation / 2 - 0.5) * 2;
        event.permutationToPlace = event.permutationToPlace.withState("ph_furn:rotation", cardinal);


        if (cardinal == 0) {
            if (block.dimension.getBlock(location_x_1).hasTag("ph_furn:curtain")) {
                world.getDimension("overworld").runCommandAsync(`/setblock ${location.x} ${location.y} ${location.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=1,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=2,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y + 1} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=3,"ph_furn:left"=false]`)
            }
            else {
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=2]`)
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y + 1} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=3]`)
            }
        }
        if (cardinal == 2) {
            if (block.dimension.getBlock(location_z_1).hasTag("ph_furn:curtain")) {
                world.getDimension("overworld").runCommandAsync(`/setblock ${location.x} ${location.y} ${location.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=1,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=2,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y + 1} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=3,"ph_furn:left"=false]`)
            }
            else {
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=2]`)
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y + 1} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=3]`)
            }
        }
        if (cardinal == 4) {
            if (block.dimension.getBlock(location_x_01).hasTag("ph_furn:curtain")) {
                world.getDimension("overworld").runCommandAsync(`/setblock ${location.x} ${location.y} ${location.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=1,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=2,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y + 1} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=3,"ph_furn:left"=false]`)
            }
            else {
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=2]`)
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y + 1} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=3]`)
            }
        }
        if (cardinal == 6) {
            if (block.dimension.getBlock(location_z_01).hasTag("ph_furn:curtain")) {
                world.getDimension("overworld").runCommandAsync(`/setblock ${location.x} ${location.y} ${location.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=1,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=2,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y + 1} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=3,"ph_furn:left"=false]`)
            }
            else {
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=2]`)
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y + 1} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=3]`)
            }
        }
    },
    onTick(event) {
        const { block } = event;
        const location = block.location;
        const blockposState = block.permutation.getState('ph_furn:pos');
        if (world.getDimension("overworld").getBlock({ x: location.x, y: location.y - 1, z: location.z }).typeId == "minecraft:air" && blockposState == 3) {
            world.getDimension("overworld").runCommand(`setblock ${location.x} ${location.y} ${location.z} air`);
        }
        if (world.getDimension("overworld").getBlock({ x: location.x, y: location.y + 1, z: location.z }).typeId == "minecraft:air" && blockposState == 2) {
            world.getDimension("overworld").runCommand(`setblock ${location.x} ${location.y} ${location.z} air`);
        }
        if (world.getDimension("overworld").getBlock({ x: location.x, y: location.y - 1, z: location.z }).typeId == "minecraft:air" && blockposState == 2) {
            world.getDimension("overworld").runCommand(`setblock ${location.x} ${location.y} ${location.z} air`);
        }
        if (world.getDimension("overworld").getBlock({ x: location.x, y: location.y + 1, z: location.z }).typeId == "minecraft:air" && blockposState == 1) {
            world.getDimension("overworld").runCommand(`setblock ${location.x} ${location.y} ${location.z} air`);
        }
    }
};
const CurtainComponent_2 = {
    onPlayerInteract(event) {
        const { block } = event;
        const blockOpenState = block.permutation.getState('ph_furn:open');
        const blockposState = block.permutation.getState('ph_furn:pos');
        let newOpenState = !blockOpenState;
        let location = block.location;
        if (blockposState == 2) {
            let block_1 = world.getDimension("overworld").getBlock({ x: location.x, y: location.y - 1, z: location.z });
            let newLowerPermutation = BlockPermutation.resolve(block.typeId, {
                ...block_1.permutation.getAllStates(),
                'ph_furn:open': newOpenState
            });
            block_1.setPermutation(newLowerPermutation);
        }
        else if (blockposState == 1) {
            let block_2 = world.getDimension("overworld").getBlock({ x: location.x, y: location.y + 1, z: location.z });
            let newposPermutation_2 = BlockPermutation.resolve(block.typeId, {
                ...block_2.permutation.getAllStates(),
                'ph_furn:open': newOpenState
            });
            block_2.setPermutation(newposPermutation_2);
        }
        let newPermutation = BlockPermutation.resolve(block.typeId, {
            ...block.permutation.getAllStates(),
            'ph_furn:open': newOpenState
        });
        block.setPermutation(newPermutation);
        if (newOpenState) {
            world.playSound("ph_furn.curtain", location);
        }
        else {
            world.playSound("ph_furn.curtain", location);
        }
    },
    beforeOnPlayerPlace(event) {
        const { block, player } = event;
        const playerYRotation = player.getRotation().y;
        const rotation = getPreciseRotation(playerYRotation);
        const equipment = player.getComponent("inventory").container;
        const selectedItem = equipment.getItem(player.selectedSlotIndex);
        const item_id = items_list[selectedItem?.typeId];
        let location = block.location;
        let posBlockLocation = { x: location.x, y: location.y + 1, z: location.z };
        let location_x_1 = { x: location.x + 1, y: location.y, z: location.z };
        let location_x_01 = { x: location.x - 1, y: location.y, z: location.z };
        let location_z_1 = { x: location.x, y: location.y, z: location.z + 1 };
        let location_z_01 = { x: location.x, y: location.y, z: location.z - 1 };
        let cardinal = Math.round(rotation / 2 - 0.5) * 2;
        event.permutationToPlace = event.permutationToPlace.withState("ph_furn:rotation", cardinal);


        if (cardinal == 0) {
            if (block.dimension.getBlock(location_x_1).hasTag("ph_furn:curtain")) {
                world.getDimension("overworld").runCommandAsync(`/setblock ${location.x} ${location.y} ${location.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=1,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=2,"ph_furn:left"=false]`)
            }
            else {
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=2]`)
            }
        }
        if (cardinal == 2) {
            if (block.dimension.getBlock(location_z_1).hasTag("ph_furn:curtain")) {
                world.getDimension("overworld").runCommandAsync(`/setblock ${location.x} ${location.y} ${location.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=1,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=2,"ph_furn:left"=false]`)
            }
            else {
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=2]`)
            }
        }
        if (cardinal == 4) {
            if (block.dimension.getBlock(location_x_01).hasTag("ph_furn:curtain")) {
                world.getDimension("overworld").runCommandAsync(`/setblock ${location.x} ${location.y} ${location.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=1,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=2,"ph_furn:left"=false]`)
            }
            else {
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=2]`)
            }
        }
        if (cardinal == 6) {
            if (block.dimension.getBlock(location_z_01).hasTag("ph_furn:curtain")) {
                world.getDimension("overworld").runCommandAsync(`/setblock ${location.x} ${location.y} ${location.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=1,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=2,"ph_furn:left"=false]`)
            }
            else {
                world.getDimension("overworld").runCommand(`/setblock ${posBlockLocation.x} ${posBlockLocation.y} ${posBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:pos"=2]`)
            }
        }
    },
    onTick(event) {
        const { block } = event;
        const location = block.location;
        const blockposState = block.permutation.getState('ph_furn:pos');
        if (world.getDimension("overworld").getBlock({ x: location.x, y: location.y - 1, z: location.z }).typeId == "minecraft:air" && blockposState == 2) {
            world.getDimension("overworld").runCommand(`setblock ${location.x} ${location.y} ${location.z} air`);
        }
        if (world.getDimension("overworld").getBlock({ x: location.x, y: location.y + 1, z: location.z }).typeId == "minecraft:air" && blockposState == 1) {
            world.getDimension("overworld").runCommand(`setblock ${location.x} ${location.y} ${location.z} air`);
        }
    }
};
const DoorComponent_3 = {
    onPlayerInteract(event) {
        const { block } = event;
        const blockOpenState = block.permutation.getState('ph_furn:open');
        const blockUpperState = block.permutation.getState('ph_furn:upper');
        let newOpenState = !blockOpenState;
        let location = block.location;
        if (blockUpperState == 3) {
            let block_2 = world.getDimension("overworld").getBlock({ x: location.x, y: location.y - 1, z: location.z });
            let newLowerPermutation_2 = BlockPermutation.resolve(block.typeId, {
                ...block_2.permutation.getAllStates(),
                'ph_furn:open': newOpenState
            });
            block_2.setPermutation(newLowerPermutation_2);
            let block_1 = world.getDimension("overworld").getBlock({ x: location.x, y: location.y - 2, z: location.z });
            let newLowerPermutation_1 = BlockPermutation.resolve(block.typeId, {
                ...block_1.permutation.getAllStates(),
                'ph_furn:open': newOpenState
            });
            block_1.setPermutation(newLowerPermutation_1);
        }
        else if (blockUpperState == 2) {
            let lowerBlock = world.getDimension("overworld").getBlock({ x: location.x, y: location.y - 1, z: location.z });
            let newLowerPermutation = BlockPermutation.resolve(block.typeId, {
                ...lowerBlock.permutation.getAllStates(),
                'ph_furn:open': newOpenState
            });
            lowerBlock.setPermutation(newLowerPermutation);
            let upperBlock = world.getDimension("overworld").getBlock({ x: location.x, y: location.y + 1, z: location.z });
            let newUpperPermutation = BlockPermutation.resolve(block.typeId, {
                ...upperBlock.permutation.getAllStates(),
                'ph_furn:open': newOpenState
            });
            upperBlock.setPermutation(newUpperPermutation);
        }
        else if (blockUpperState == 1) {
            let block_2 = world.getDimension("overworld").getBlock({ x: location.x, y: location.y + 1, z: location.z });
            let newUpperPermutation_2 = BlockPermutation.resolve(block.typeId, {
                ...block_2.permutation.getAllStates(),
                'ph_furn:open': newOpenState
            });
            block_2.setPermutation(newUpperPermutation_2);
            let block_3 = world.getDimension("overworld").getBlock({ x: location.x, y: location.y + 2, z: location.z });
            let newUpperPermutation_3 = BlockPermutation.resolve(block.typeId, {
                ...block_3.permutation.getAllStates(),
                'ph_furn:open': newOpenState
            });
            block_3.setPermutation(newUpperPermutation_3);
        }
        let newPermutation = BlockPermutation.resolve(block.typeId, {
            ...block.permutation.getAllStates(),
            'ph_furn:open': newOpenState
        });
        block.setPermutation(newPermutation);
        if (newOpenState) {
            world.playSound("open.wooden_door", location);
        }
        else {
            world.playSound("close.wooden_door", location);
        }
    },
    beforeOnPlayerPlace(event) {
        const { block, player } = event;
        const playerYRotation = player.getRotation().y;
        const rotation = getPreciseRotation(playerYRotation);
        const equipment = player.getComponent("inventory").container;
        const selectedItem = equipment.getItem(player.selectedSlotIndex);
        const item_id = items_list[selectedItem?.typeId];
        let location = block.location;
        let upperBlockLocation = { x: location.x, y: location.y + 1, z: location.z };
        let location_x_1 = { x: location.x + 1, y: location.y, z: location.z };
        let location_x_01 = { x: location.x - 1, y: location.y, z: location.z };
        let location_z_1 = { x: location.x, y: location.y, z: location.z + 1 };
        let location_z_01 = { x: location.x, y: location.y, z: location.z - 1 };
        let cardinal = Math.round(rotation / 2 - 0.5) * 2;
        event.permutationToPlace = event.permutationToPlace.withState("ph_furn:rotation", cardinal);


        if (cardinal == 0) {
            if (block.dimension.getBlock(location_x_1).hasTag("ph_furn:door")) {
                world.getDimension("overworld").runCommandAsync(`/setblock ${location.x} ${location.y} ${location.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=1,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=2,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y + 1} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=3,"ph_furn:left"=false]`)
            }
            else {
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=2]`)
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y + 1} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=3]`)
            }
        }
        if (cardinal == 2) {
            if (block.dimension.getBlock(location_z_1).hasTag("ph_furn:door")) {
                world.getDimension("overworld").runCommandAsync(`/setblock ${location.x} ${location.y} ${location.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=1,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=2,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y + 1} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=3,"ph_furn:left"=false]`)
            }
            else {
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=2]`)
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y + 1} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=3]`)
            }
        }
        if (cardinal == 4) {
            if (block.dimension.getBlock(location_x_01).hasTag("ph_furn:door")) {
                world.getDimension("overworld").runCommandAsync(`/setblock ${location.x} ${location.y} ${location.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=1,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=2,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y + 1} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=3,"ph_furn:left"=false]`)
            }
            else {
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=2]`)
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y + 1} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=3]`)
            }
        }
        if (cardinal == 6) {
            if (block.dimension.getBlock(location_z_01).hasTag("ph_furn:door")) {
                world.getDimension("overworld").runCommandAsync(`/setblock ${location.x} ${location.y} ${location.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=1,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=2,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y + 1} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=3,"ph_furn:left"=false]`)
            }
            else {
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=2]`)
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y + 1} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=3]`)
            }
        }
    },
    onTick(event) {
        const { block } = event;
        const location = block.location;
        const blockUpperState = block.permutation.getState('ph_furn:upper');
        if (world.getDimension("overworld").getBlock({ x: location.x, y: location.y - 1, z: location.z }).typeId == "minecraft:air" && blockUpperState == 3) {
            world.getDimension("overworld").runCommand(`setblock ${location.x} ${location.y} ${location.z} air`);
        }
        if (world.getDimension("overworld").getBlock({ x: location.x, y: location.y + 1, z: location.z }).typeId == "minecraft:air" && blockUpperState == 2) {
            world.getDimension("overworld").runCommand(`setblock ${location.x} ${location.y} ${location.z} air`);
        }
        if (world.getDimension("overworld").getBlock({ x: location.x, y: location.y - 1, z: location.z }).typeId == "minecraft:air" && blockUpperState == 2) {
            world.getDimension("overworld").runCommand(`setblock ${location.x} ${location.y} ${location.z} air`);
        }
        if (world.getDimension("overworld").getBlock({ x: location.x, y: location.y + 1, z: location.z }).typeId == "minecraft:air" && blockUpperState == 1) {
            world.getDimension("overworld").runCommand(`setblock ${location.x} ${location.y} ${location.z} air`);
        }
    }
};
const DoorComponent_2 = {
    onPlayerInteract(event) {
        const { block } = event;
        const blockOpenState = block.permutation.getState('ph_furn:open');
        const blockUpperState = block.permutation.getState('ph_furn:upper');
        let newOpenState = !blockOpenState;
        let location = block.location;
        if (blockUpperState == 2) {
            let lowerBlock = world.getDimension("overworld").getBlock({ x: location.x, y: location.y - 1, z: location.z });
            let newLowerPermutation = BlockPermutation.resolve(block.typeId, {
                ...lowerBlock.permutation.getAllStates(),
                'ph_furn:open': newOpenState
            });
            lowerBlock.setPermutation(newLowerPermutation);
        }
        else if (blockUpperState == 1) {
            let block_2 = world.getDimension("overworld").getBlock({ x: location.x, y: location.y + 1, z: location.z });
            let newUpperPermutation_2 = BlockPermutation.resolve(block.typeId, {
                ...block_2.permutation.getAllStates(),
                'ph_furn:open': newOpenState
            });
            block_2.setPermutation(newUpperPermutation_2);
        }
        let newPermutation = BlockPermutation.resolve(block.typeId, {
            ...block.permutation.getAllStates(),
            'ph_furn:open': newOpenState
        });
        block.setPermutation(newPermutation);
        if (newOpenState) {
            world.playSound("open.wooden_door", location);
        }
        else {
            world.playSound("close.wooden_door", location);
        }
    },
    beforeOnPlayerPlace(event) {
        const { block, player } = event;
        const playerYRotation = player.getRotation().y;
        const rotation = getPreciseRotation(playerYRotation);
        const equipment = player.getComponent("inventory").container;
        const selectedItem = equipment.getItem(player.selectedSlotIndex);
        const item_id = items_list[selectedItem?.typeId];

        let location = block.location;
        let upperBlockLocation = { x: location.x, y: location.y + 1, z: location.z };
        let location_x_1 = { x: location.x + 1, y: location.y, z: location.z };
        let location_x_01 = { x: location.x - 1, y: location.y, z: location.z };
        let location_z_1 = { x: location.x, y: location.y, z: location.z + 1 };
        let location_z_01 = { x: location.x, y: location.y, z: location.z - 1 };
        let cardinal = Math.round(rotation / 2 - 0.5) * 2;
        event.permutationToPlace = event.permutationToPlace.withState("ph_furn:rotation", cardinal)

        if (cardinal == 0) {
            if (block.dimension.getBlock(location_x_1).hasTag("ph_furn:door")) {
                world.getDimension("overworld").runCommandAsync(`/setblock ${location.x} ${location.y} ${location.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=1,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=2,"ph_furn:left"=false]`)
            }
            else {
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=2]`)
            }
        }
        if (cardinal == 2) {
            if (block.dimension.getBlock(location_z_1).hasTag("ph_furn:door")) {
                world.getDimension("overworld").runCommandAsync(`/setblock ${location.x} ${location.y} ${location.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=1,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=2,"ph_furn:left"=false]`)
            }
            else {
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=2]`)
            }
        }
        if (cardinal == 4) {
            if (block.dimension.getBlock(location_x_01).hasTag("ph_furn:door")) {
                world.getDimension("overworld").runCommandAsync(`/setblock ${location.x} ${location.y} ${location.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=1,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=2,"ph_furn:left"=false]`)
            }
            else {
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=2]`)
            }
        }
        if (cardinal == 6) {
            if (block.dimension.getBlock(location_z_01).hasTag("ph_furn:door")) {
                world.getDimension("overworld").runCommandAsync(`/setblock ${location.x} ${location.y} ${location.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=1,"ph_furn:left"=false]`)
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=2,"ph_furn:left"=false]`)
            }
            else {
                world.getDimension("overworld").runCommand(`/setblock ${upperBlockLocation.x} ${upperBlockLocation.y} ${upperBlockLocation.z} ${item_id.block}["ph_furn:rotation"=${cardinal},"ph_furn:upper"=2]`)
            }
        }
    },
    onTick(event) {
        const { block } = event;
        const location = block.location;
        const blockUpperState = block.permutation.getState('ph_furn:upper');
        if (world.getDimension("overworld").getBlock({ x: location.x, y: location.y - 1, z: location.z }).typeId == "minecraft:air" && blockUpperState == 2) {
            world.getDimension("overworld").runCommand(`setblock ${location.x} ${location.y} ${location.z} air`);
        }
        if (world.getDimension("overworld").getBlock({ x: location.x, y: location.y + 1, z: location.z }).typeId == "minecraft:air" && blockUpperState == 1) {
            world.getDimension("overworld").runCommand(`setblock ${location.x} ${location.y} ${location.z} air`);
        }
    }
};
const RideComponent = {
    onPlayerInteract(event) {
        const { block, player } = event;
        const location = block.location;
        const block_ride = block.permutation.getState('ph_furn:ride');

        if (block_ride == false) {
            if (block.typeId.includes("bathtub") || block.typeId.includes("float_lounger")) {
                const ride_location = { x: location.x + 0.5, y: location.y + 0.0, z: location.z + 0.5 };
                const ride = block.dimension.spawnEntity("ph_furn:ride", ride_location);
                let newPermutation = BlockPermutation.resolve(block.typeId, {
                    ...block.permutation.getAllStates(),
                    'ph_furn:ride': true
                });
                block.setPermutation(newPermutation);
                const addrider = ride.getComponent("rideable");
                addrider.addRider(player);
            } else if (block.typeId.includes("sun_lounger") || block.typeId.includes("bench") || block.typeId.includes("sofa") || block.typeId.includes("couch") || block.typeId.includes("sun_chair")) {
                const ride_location = { x: location.x + 0.5, y: location.y + 0.23, z: location.z + 0.5 };
                const ride = block.dimension.spawnEntity("ph_furn:ride", ride_location);
                let newPermutation = BlockPermutation.resolve(block.typeId, {
                    ...block.permutation.getAllStates(),
                    'ph_furn:ride': true
                });
                block.setPermutation(newPermutation);
                const addrider = ride.getComponent("rideable");
                addrider.addRider(player);
            } else {
                const ride_location = { x: location.x + 0.5, y: location.y + 0.4, z: location.z + 0.5 };
                const ride = block.dimension.spawnEntity("ph_furn:ride", ride_location);
                let newPermutation = BlockPermutation.resolve(block.typeId, {
                    ...block.permutation.getAllStates(),
                    'ph_furn:ride': true
                });
                block.setPermutation(newPermutation);
                const addrider = ride.getComponent("rideable");
                addrider.addRider(player);
            }
        }
    },
    onTick(event) {
        const { block } = event;
        const location = block.location;
        if (block.typeId.includes("bathtub") || block.typeId.includes("float_lounger")) {
            const ride_location = { x: location.x + 0.5, y: location.y + 0.0, z: location.z + 0.5 };
            const block_ride = block.permutation.getState('ph_furn:ride');
            if (block_ride == true) {
                try {
                    const ride = block.dimension.getEntities({ type: 'ph_furn:ride', location: ride_location, maxDistance: 0.1, });

                    for (const entity of ride) {
                        const despawn = entity.getComponent("is_stunned");
                        if (despawn) {
                            let newPermutation = BlockPermutation.resolve(block.typeId, {
                                ...block.permutation.getAllStates(),
                                'ph_furn:ride': false
                            });
                            block.setPermutation(newPermutation);
                            return;
                        }
                    }
                } catch { }
            }
        } else if (block.typeId.includes("sun_lounger") || block.typeId.includes("bench") || block.typeId.includes("sofa") || block.typeId.includes("couch") || block.typeId.includes("sun_chair")) {
            const ride_location = { x: location.x + 0.5, y: location.y + 0.23, z: location.z + 0.5 };
            const block_ride = block.permutation.getState('ph_furn:ride');
            if (block_ride == true) {
                try {
                    const ride = block.dimension.getEntities({ type: 'ph_furn:ride', location: ride_location, maxDistance: 0.1, });

                    for (const entity of ride) {
                        const despawn = entity.getComponent("is_stunned");
                        if (despawn) {
                            let newPermutation = BlockPermutation.resolve(block.typeId, {
                                ...block.permutation.getAllStates(),
                                'ph_furn:ride': false
                            });
                            block.setPermutation(newPermutation);
                            return;
                        }
                    }
                } catch { }
            }
        } else {
            const ride_location = { x: location.x + 0.5, y: location.y + 0.4, z: location.z + 0.5 };
            const block_ride = block.permutation.getState('ph_furn:ride');
            if (block_ride == true) {
                try {
                    const ride = block.dimension.getEntities({ type: 'ph_furn:ride', location: ride_location, maxDistance: 0.1, });

                    for (const entity of ride) {
                        const despawn = entity.getComponent("is_stunned");
                        if (despawn) {
                            let newPermutation = BlockPermutation.resolve(block.typeId, {
                                ...block.permutation.getAllStates(),
                                'ph_furn:ride': false
                            });
                            block.setPermutation(newPermutation);
                            return;
                        }
                    }
                } catch { }
            }
        }

    }
};
world.beforeEvents.worldInitialize.subscribe(({ blockComponentRegistry }) => {
    blockComponentRegistry.registerCustomComponent("ph_furn:play_bolck", PlayComponent);
    blockComponentRegistry.registerCustomComponent("ph_furn:fire_bolck", FireComponent);
    blockComponentRegistry.registerCustomComponent("ph_furn:lamp_bolck", LampComponent);
    blockComponentRegistry.registerCustomComponent("ph_furn:tree_bolck", TreeComponent_4);
    blockComponentRegistry.registerCustomComponent("ph_furn:curtain_2_bolck", CurtainComponent_2);
    blockComponentRegistry.registerCustomComponent("ph_furn:curtain_3_bolck", CurtainComponent_3);
    blockComponentRegistry.registerCustomComponent("ph_furn:door_3_bolck", DoorComponent_3);
    blockComponentRegistry.registerCustomComponent("ph_furn:door_2_bolck", DoorComponent_2);
    blockComponentRegistry.registerCustomComponent("ph_furn:ride_bolck", RideComponent);
});
