import { BlockPermutation } from '@minecraft/server';
import { decrementStack } from '../utils/helper';
class beforeOnPlayerPlace {
    constructor() {
        this.beforeOnPlayerPlace = this.beforeOnPlayerPlace.bind(this);
    }
    beforeOnPlayerPlace(_componentData) { }
}
export class bench extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = componentData.dimension;
        const location = block.location;
        if (cardinal_direction == 'north' &&
            block.west().typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            dimension
                .spawnEntity('bf_dc:sit', {
                x: location.x + 0.5,
                y: location.y + 0.5,
                z: location.z + 0.5
            })
                .addTag(`bench`);
            dimension
                .spawnEntity('bf_dc:sit', {
                x: location.x - 0.5,
                y: location.y + 0.5,
                z: location.z + 0.5
            })
                .addTag(`bench`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:bench_slab', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.west().setPermutation(BlockPermutation.resolve('bf_dc:bench_slab', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'south' &&
            block.east().typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            dimension
                .spawnEntity('bf_dc:sit', {
                x: location.x + 0.5,
                y: location.y + 0.5,
                z: location.z + 0.5
            })
                .addTag(`bench`);
            dimension
                .spawnEntity('bf_dc:sit', {
                x: location.x + 1.5,
                y: location.y + 0.5,
                z: location.z + 0.5
            })
                .addTag(`bench`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:bench_slab', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.east().setPermutation(BlockPermutation.resolve('bf_dc:bench_slab', {
                'minecraft:cardinal_direction': 'south'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'east' &&
            block.north().typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            dimension
                .spawnEntity('bf_dc:sit', {
                x: location.x + 0.5,
                y: location.y + 0.5,
                z: location.z + 0.5
            })
                .addTag(`bench`);
            dimension
                .spawnEntity('bf_dc:sit', {
                x: location.x + 0.5,
                y: location.y + 0.5,
                z: location.z - 0.5
            })
                .addTag(`bench`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:bench_slab', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.north().setPermutation(BlockPermutation.resolve('bf_dc:bench_slab', {
                'minecraft:cardinal_direction': 'east'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'west' &&
            block.south().typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            dimension
                .spawnEntity('bf_dc:sit', {
                x: location.x + 0.5,
                y: location.y + 0.5,
                z: location.z + 1.5
            })
                .addTag(`bench`);
            dimension
                .spawnEntity('bf_dc:sit', {
                x: location.x + 0.5,
                y: location.y + 0.5,
                z: location.z + 0.5
            })
                .addTag(`bench`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:bench_slab', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.south().setPermutation(BlockPermutation.resolve('bf_dc:bench_slab', {
                'minecraft:cardinal_direction': 'west'
            }));
            decrementStack(componentData.player);
        }
        componentData.cancel = true;
    }
}
export class full extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (cardinal_direction == 'north') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'south') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'south'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'east') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'east'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'west') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'west'
            }));
            decrementStack(componentData.player);
        }
        componentData.cancel = true;
    }
}
export class chair extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const location = componentData.block.location;
        componentData.dimension
            .spawnEntity('bf_dc:sit', {
            x: location.x + 0.5,
            y: location.y + 0.75,
            z: location.z + 0.5
        })
            .addTag(`chair`);
    }
}
export class armchair extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const location = componentData.block.location;
        componentData.dimension
            .spawnEntity('bf_dc:sit', {
            x: location.x + 0.5,
            y: location.y + 0.4,
            z: location.z + 0.5
        })
            .addTag(`chair`);
    }
}
export class half extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (cardinal_direction == 'north') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:half', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'south') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:half', {
                'minecraft:cardinal_direction': 'south'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'east') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:half', {
                'minecraft:cardinal_direction': 'east'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'west') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:half', {
                'minecraft:cardinal_direction': 'west'
            }));
            decrementStack(componentData.player);
        }
        componentData.cancel = true;
    }
}
export class fullWithout extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (cardinal_direction == 'north') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full_without', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'south') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full_without', {
                'minecraft:cardinal_direction': 'south'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'east') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full_without', {
                'minecraft:cardinal_direction': 'east'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'west') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full_without', {
                'minecraft:cardinal_direction': 'west'
            }));
            decrementStack(componentData.player);
        }
        componentData.cancel = true;
    }
}
export class table extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (cardinal_direction == 'north' &&
            block.east().typeId == 'minecraft:air' &&
            block.west().typeId == 'minecraft:air' &&
            block.south().typeId == 'minecraft:air' &&
            block.offset({ x: 1, y: 0, z: 1 }).typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 0, z: 1 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.east().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.west().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.south().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 1, y: 0, z: 1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: -1, y: 0, z: 1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        else if (cardinal_direction == 'south' &&
            block.east().typeId == 'minecraft:air' &&
            block.west().typeId == 'minecraft:air' &&
            block.north().typeId == 'minecraft:air' &&
            block.offset({ x: 1, y: 0, z: -1 }).typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 0, z: -1 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.east().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.west().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.north().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.offset({ x: 1, y: 0, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.offset({ x: -1, y: 0, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'south'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        else if (cardinal_direction == 'east' &&
            block.north().typeId == 'minecraft:air' &&
            block.south().typeId == 'minecraft:air' &&
            block.west().typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 0, z: -1 }).typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 0, z: 1 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.north().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.south().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.west().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: -1, y: 0, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: -1, y: 0, z: 1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        else if (cardinal_direction == 'west' &&
            block.north().typeId == 'minecraft:air' &&
            block.south().typeId == 'minecraft:air' &&
            block.east().typeId == 'minecraft:air' &&
            block.offset({ x: 1, y: 0, z: -1 }).typeId == 'minecraft:air' &&
            block.offset({ x: 1, y: 0, z: 1 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.north().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.south().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.east().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 1, y: 0, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 1, y: 0, z: 1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        componentData.cancel = true;
    }
}
export class slab extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (cardinal_direction == 'north') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:slab', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'south') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:slab', {
                'minecraft:cardinal_direction': 'south'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'east') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:slab', {
                'minecraft:cardinal_direction': 'east'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'west') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:slab', {
                'minecraft:cardinal_direction': 'west'
            }));
            decrementStack(componentData.player);
        }
        componentData.cancel = true;
    }
}
export class tub extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (cardinal_direction == 'north' &&
            block.west().typeId == 'minecraft:air' &&
            block.south().typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 0, z: 1 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x + 0.5} ${location.y} ${location.z + 0.5} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.west().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.south().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: -1, y: 0, z: 1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:tub_location', block.location);
            }
        }
        else if (cardinal_direction == 'south' &&
            block.east().typeId == 'minecraft:air' &&
            block.north().typeId == 'minecraft:air' &&
            block.offset({ x: 1, y: 0, z: -1 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x + 0.5} ${location.y} ${location.z + 0.5} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.east().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.north().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.offset({ x: 1, y: 0, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'south'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:tub_location', block.location);
            }
        }
        else if (cardinal_direction == 'east' &&
            block.north().typeId == 'minecraft:air' &&
            block.west().typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 0, z: -1 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.north().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.west().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.offset({ x: -1, y: 0, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'east'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:tub_location', block.location);
            }
        }
        else if (cardinal_direction == 'west' &&
            block.south().typeId == 'minecraft:air' &&
            block.east().typeId == 'minecraft:air' &&
            block.offset({ x: 1, y: 0, z: 1 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.south().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.east().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.offset({ x: 1, y: 0, z: 1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'west'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:tub_location', block.location);
            }
        }
        componentData.cancel = true;
    }
}
export class wardrobe extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (cardinal_direction == 'north' &&
            block.west().typeId == 'minecraft:air' &&
            block.above().typeId == 'minecraft:air' &&
            block.above(2).typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 1, z: 0 }).typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 2, z: 0 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x + 0.025} ${location.y} ${location.z + 0.5} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.west().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.above(2).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: -1, y: 1, z: 0 }).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: -1, y: 2, z: 0 }).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:tub_location', block.location);
            }
        }
        else if (cardinal_direction == 'south' &&
            block.west().typeId == 'minecraft:air' &&
            block.above().typeId == 'minecraft:air' &&
            block.above(2).typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 1, z: 0 }).typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 2, z: 0 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x - 0.025} ${location.y} ${location.z + 0.5} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.west().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.above(2).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.offset({ x: -1, y: 1, z: 0 }).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.offset({ x: -1, y: 2, z: 0 }).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'south'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:tub_location', block.location);
            }
        }
        else if (cardinal_direction == 'east' &&
            block.north().typeId == 'minecraft:air' &&
            block.above().typeId == 'minecraft:air' &&
            block.above(2).typeId == 'minecraft:air' &&
            block.offset({ x: 0, y: 1, z: -1 }).typeId == 'minecraft:air' &&
            block.offset({ x: 0, y: 2, z: -1 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x + 0.5} ${location.y} ${location.z + 0.025} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.north().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.above(2).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.offset({ x: 0, y: 1, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.offset({ x: 0, y: 2, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'east'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:tub_location', block.location);
            }
        }
        else if (cardinal_direction == 'west' &&
            block.north().typeId == 'minecraft:air' &&
            block.above().typeId == 'minecraft:air' &&
            block.above(2).typeId == 'minecraft:air' &&
            block.offset({ x: 0, y: 1, z: -1 }).typeId == 'minecraft:air' &&
            block.offset({ x: 0, y: 2, z: -1 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x + 0.5} ${location.y} ${location.z - 0.025} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.north().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.above(2).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.offset({ x: 0, y: 1, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.offset({ x: 0, y: 2, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'west'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:tub_location', block.location);
            }
        }
        componentData.cancel = true;
    }
}
export class crate extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (cardinal_direction == 'north' &&
            block.east().typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            if (blockToPlace.type.id.includes('crate')) { dimension.runCommand(`execute positioned ${location.x + 1} ${location.y} ${location.z} run summon bf_dc:wooden_crate_utility ~~~`); }
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.east().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:crate_location', block.location);
            }
        }
        else if (cardinal_direction == 'south' &&
            block.west().typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            if (blockToPlace.type.id.includes('crate')) { dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z - 1} run summon bf_dc:wooden_crate_utility ~~~`); }
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.west().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:crate_location', block.location);
            }
        }
        else if (cardinal_direction == 'east' &&
            block.south().typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            if (blockToPlace.type.id.includes('crate')) { dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z + 1} run summon bf_dc:wooden_crate_utility ~~~`); }
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.south().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:crate_location', block.location);
            }
        }
        else if (cardinal_direction == 'west' &&
            block.north().typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            if (blockToPlace.type.id.includes('crate')) { dimension.runCommand(`execute positioned ${location.x - 1} ${location.y} ${location.z} run summon bf_dc:wooden_crate_utility ~~~`); }
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.north().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:crate_location', block.location);
            }
        }
        componentData.cancel = true;
    }
}
export class backpack extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (cardinal_direction == 'north') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'south') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'east') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'west') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            decrementStack(componentData.player);
        }
        componentData.cancel = true;
    }
}
export class bed extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (cardinal_direction == 'north' &&
            block.east().typeId == 'minecraft:air' &&
            block.south().typeId == 'minecraft:air' &&
            block.offset({ x: 1, y: 0, z: 1 }).typeId == 'minecraft:air' &&
            block.offset({ x: 1, y: 0, z: 2 }).typeId == 'minecraft:air' &&
            block.offset({ x: 0, y: 0, z: 2 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x + 0.9955} ${location.y} ${location.z + 1} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.east().setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.south().setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 1, y: 0, z: 1 }).setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 1, y: 0, z: 2 }).setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 0, y: 0, z: 2 }).setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.dimension
                .spawnEntity('bf_dc:sit<bf_dc:on_bed>', {
                x: location.x + 0.5,
                y: location.y + 0.25,
                z: location.z + 0.5
            })
                .addTag(`bed`);
            block.dimension
                .spawnEntity('bf_dc:sit<bf_dc:on_bed>', {
                x: location.x + 0.5,
                y: location.y + 0.25,
                z: location.z + 1.5
            })
                .addTag(`bed`);
            block.dimension
                .spawnEntity('bf_dc:sit<bf_dc:on_bed>', {
                x: location.x + 1.5,
                y: location.y + 0.25,
                z: location.z + 0.5
            })
                .addTag(`bed`);
            block.dimension
                .spawnEntity('bf_dc:sit<bf_dc:on_bed>', {
                x: location.x + 1.5,
                y: location.y + 0.25,
                z: location.z + 1.5
            })
                .addTag(`bed`);
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                type: blockToPlace.type.id,
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:bed_location', block.location);
            }
        }
        else if (cardinal_direction == 'south' &&
            block.west().typeId == 'minecraft:air' &&
            block.north().typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 0, z: -1 }).typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 0, z: -2 }).typeId == 'minecraft:air' &&
            block.offset({ x: 0, y: 0, z: -2 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x - 0.005} ${location.y} ${location.z - 1} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.west().setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.north().setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.offset({ x: -1, y: 0, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.offset({ x: -1, y: 0, z: -2 }).setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.offset({ x: 0, y: 0, z: -2 }).setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.dimension
                .spawnEntity('bf_dc:sit<bf_dc:on_bed>', {
                x: location.x + 0.5,
                y: location.y + 0.25,
                z: location.z + 0.5
            })
                .addTag(`bed`);
            block.dimension
                .spawnEntity('bf_dc:sit<bf_dc:on_bed>', {
                x: location.x + 0.5,
                y: location.y + 0.25,
                z: location.z - 0.5
            })
                .addTag(`bed`);
            block.dimension
                .spawnEntity('bf_dc:sit<bf_dc:on_bed>', {
                x: location.x - 0.5,
                y: location.y + 0.25,
                z: location.z + 0.5
            })
                .addTag(`bed`);
            block.dimension
                .spawnEntity('bf_dc:sit<bf_dc:on_bed>', {
                x: location.x - 0.5,
                y: location.y + 0.25,
                z: location.z - 0.5
            })
                .addTag(`bed`);
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        else if (cardinal_direction == 'east' &&
            block.south().typeId == 'minecraft:air' &&
            block.west().typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 0, z: 1 }).typeId == 'minecraft:air' &&
            block.offset({ x: -2, y: 0, z: 1 }).typeId == 'minecraft:air' &&
            block.offset({ x: -2, y: 0, z: 0 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x - 1} ${location.y} ${location.z + 0.9955} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.south().setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.west().setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: -1, y: 0, z: 1 }).setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: -2, y: 0, z: 1 }).setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: -2, y: 0, z: 0 }).setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.dimension
                .spawnEntity('bf_dc:sit<bf_dc:on_bed>', {
                x: location.x + 0.5,
                y: location.y + 0.25,
                z: location.z + 0.5
            })
                .addTag(`bed`);
            block.dimension
                .spawnEntity('bf_dc:sit<bf_dc:on_bed>', {
                x: location.x - 0.5,
                y: location.y + 0.25,
                z: location.z + 0.5
            })
                .addTag(`bed`);
            block.dimension
                .spawnEntity('bf_dc:sit<bf_dc:on_bed>', {
                x: location.x - 0.5,
                y: location.y + 0.25,
                z: location.z + 1.5
            })
                .addTag(`bed`);
            block.dimension
                .spawnEntity('bf_dc:sit<bf_dc:on_bed>', {
                x: location.x + 0.5,
                y: location.y + 0.25,
                z: location.z + 1.5
            })
                .addTag(`bed`);
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        else if (cardinal_direction == 'west' &&
            block.north().typeId == 'minecraft:air' &&
            block.east().typeId == 'minecraft:air' &&
            block.offset({ x: 1, y: 0, z: -1 }).typeId == 'minecraft:air' &&
            block.offset({ x: 2, y: 0, z: -1 }).typeId == 'minecraft:air' &&
            block.offset({ x: 2, y: 0, z: 0 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x + 1} ${location.y} ${location.z - 0.005} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.north().setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.east().setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 1, y: 0, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 2, y: 0, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 2, y: 0, z: 0 }).setPermutation(BlockPermutation.resolve('bf_dc:bed_null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.dimension
                .spawnEntity('bf_dc:sit<bf_dc:on_bed>', {
                x: location.x + 0.5,
                y: location.y + 0.25,
                z: location.z + 0.5
            })
                .addTag(`bed`);
            block.dimension
                .spawnEntity('bf_dc:sit<bf_dc:on_bed>', {
                x: location.x + 1.5,
                y: location.y + 0.25,
                z: location.z + 0.5
            })
                .addTag(`bed`);
            block.dimension
                .spawnEntity('bf_dc:sit<bf_dc:on_bed>', {
                x: location.x + 0.5,
                y: location.y + 0.25,
                z: location.z - 0.5
            })
                .addTag(`bed`);
            block.dimension
                .spawnEntity('bf_dc:sit<bf_dc:on_bed>', {
                x: location.x + 1.5,
                y: location.y + 0.25,
                z: location.z - 0.5
            })
                .addTag(`bed`);
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        componentData.cancel = true;
    }
}
export class cage extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (cardinal_direction == 'north') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'south') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'east') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'west') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            decrementStack(componentData.player);
        }
        componentData.cancel = true;
    }
}
export class minusSlab extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (cardinal_direction == 'north') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:slab', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'south') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:slab', {
                'minecraft:cardinal_direction': 'south'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'east') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:slab', {
                'minecraft:cardinal_direction': 'east'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'west') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:slab', {
                'minecraft:cardinal_direction': 'west'
            }));
            decrementStack(componentData.player);
        }
        componentData.cancel = true;
    }
}
export class piano extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (cardinal_direction == 'north' &&
            block.west().typeId == 'minecraft:air' &&
            block.south().typeId == 'minecraft:air' &&
            block.offset({ x: 0, y: 0, z: 2 }).typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 0, z: 1 }).typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 0, z: 2 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x + 0.5} ${location.y} ${location.z + 0.5} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.west().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.south().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 0, y: 0, z: 2 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: -1, y: 0, z: 1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: -1, y: 0, z: 2 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                type: blockToPlace.type.id,
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:bed_location', block.location);
            }
        }
        else if (cardinal_direction == 'south' &&
            block.east().typeId == 'minecraft:air' &&
            block.north().typeId == 'minecraft:air' &&
            block.offset({ x: 0, y: 0, z: -2 }).typeId == 'minecraft:air' &&
            block.offset({ x: 1, y: 0, z: -1 }).typeId == 'minecraft:air' &&
            block.offset({ x: 1, y: 0, z: -2 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x + 0.5} ${location.y} ${location.z + 0.5} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.east().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.north().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 0, y: 0, z: -2 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 1, y: 0, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 1, y: 0, z: -2 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        else if (cardinal_direction == 'east' &&
            block.west().typeId == 'minecraft:air' &&
            block.north().typeId == 'minecraft:air' &&
            block.offset({ x: -2, y: 0, z: 0 }).typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 0, z: -1 }).typeId == 'minecraft:air' &&
            block.offset({ x: -2, y: 0, z: -1 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x - 1} ${location.y} ${location.z + 0.9955} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.west().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.north().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: -2, y: 0, z: 0 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: -1, y: 0, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: -2, y: 0, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        else if (cardinal_direction == 'west' &&
            block.east().typeId == 'minecraft:air' &&
            block.south().typeId == 'minecraft:air' &&
            block.offset({ x: 2, y: 0, z: 0 }).typeId == 'minecraft:air' &&
            block.offset({ x: 1, y: 0, z: 1 }).typeId == 'minecraft:air' &&
            block.offset({ x: 2, y: 0, z: 1 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x + 0.5} ${location.y} ${location.z + 0.5} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.east().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.south().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 2, y: 0, z: 0 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 1, y: 0, z: 1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 2, y: 0, z: 1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        componentData.cancel = true;
    }
}
export class doorBell extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (cardinal_direction == 'north') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:half_pillar_horizontal', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'south') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:half_pillar_horizontal', {
                'minecraft:cardinal_direction': 'south'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'east') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:half_pillar_horizontal', {
                'minecraft:cardinal_direction': 'east'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'west') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:half_pillar_horizontal', {
                'minecraft:cardinal_direction': 'west'
            }));
            decrementStack(componentData.player);
        }
        componentData.cancel = true;
    }
}
export class fireplace extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (cardinal_direction == 'north' &&
            block.east().typeId == 'minecraft:air' &&
            block.above().typeId == 'minecraft:air' &&
            block.west().typeId == 'minecraft:air' &&
            block.offset({ x: 1, y: 1, z: 0 }).typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 1, z: 0 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.east().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.west().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 1, y: 1, z: 0 }).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: -1, y: 1, z: 0 }).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                type: blockToPlace.type.id,
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:bed_location', block.location);
            }
        }
        else if (cardinal_direction == 'south' &&
            block.east().typeId == 'minecraft:air' &&
            block.above().typeId == 'minecraft:air' &&
            block.west().typeId == 'minecraft:air' &&
            block.offset({ x: 1, y: 1, z: 0 }).typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 1, z: 0 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.east().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.west().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 1, y: 1, z: 0 }).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: -1, y: 1, z: 0 }).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        else if (cardinal_direction == 'east' &&
            block.north().typeId == 'minecraft:air' &&
            block.above().typeId == 'minecraft:air' &&
            block.south().typeId == 'minecraft:air' &&
            block.offset({ x: 0, y: 1, z: 1 }).typeId == 'minecraft:air' &&
            block.offset({ x: 0, y: 1, z: -1 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.north().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.south().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 0, y: 1, z: 1 }).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 0, y: 1, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        else if (cardinal_direction == 'west' &&
            block.north().typeId == 'minecraft:air' &&
            block.above().typeId == 'minecraft:air' &&
            block.south().typeId == 'minecraft:air' &&
            block.offset({ x: 0, y: 1, z: 1 }).typeId == 'minecraft:air' &&
            block.offset({ x: 0, y: 1, z: -1 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.north().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.south().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 0, y: 1, z: 1 }).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 0, y: 1, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        componentData.cancel = true;
    }
}
export class flag extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (cardinal_direction == 'north' &&
            block.above().typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:half_pillar', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:half_pillar', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                type: blockToPlace.type.id,
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:bed_location', block.location);
            }
        }
        else if (cardinal_direction == 'south' &&
            block.above().typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:half_pillar', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:half_pillar', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        else if (cardinal_direction == 'east' &&
            block.above().typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:half_pillar', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:half_pillar', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        else if (cardinal_direction == 'west' &&
            block.above().typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:half_pillar', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:half_pillar', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        componentData.cancel = true;
    }
}
export class fullHorizontal extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (cardinal_direction == 'north') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full_horizontal', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'south') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full_horizontal', {
                'minecraft:cardinal_direction': 'south'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'east') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full_horizontal', {
                'minecraft:cardinal_direction': 'east'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'west') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full_horizontal', {
                'minecraft:cardinal_direction': 'west'
            }));
            decrementStack(componentData.player);
        }
        componentData.cancel = true;
    }
}
export class fountain extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (block.above().typeId != 'minecraft:air')
            return;
        if (cardinal_direction == 'north') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'south') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'south'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'east') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'east'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'west') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'west'
            }));
            decrementStack(componentData.player);
        }
        componentData.cancel = true;
    }
}
export class grandpaClock extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (block.above().typeId != 'minecraft:air' ||
            block.above(2).typeId != 'minecraft:air')
            return;
        if (cardinal_direction == 'north') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.above(2).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'south') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.above(2).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'south'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'east') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.above(2).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'east'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'west') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.above(2).setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'west'
            }));
            decrementStack(componentData.player);
        }
        componentData.cancel = true;
    }
}
export class balloon extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (block.above().typeId != 'minecraft:air')
            return;
        if (cardinal_direction == 'north') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full_without', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full_without', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'south') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full_without', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full_without', {
                'minecraft:cardinal_direction': 'south'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'east') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full_without', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full_without', {
                'minecraft:cardinal_direction': 'east'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'west') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full_without', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full_without', {
                'minecraft:cardinal_direction': 'west'
            }));
            decrementStack(componentData.player);
        }
        componentData.cancel = true;
    }
}
export class knight extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (block.above().typeId != 'minecraft:air')
            return;
        if (cardinal_direction == 'north') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'south') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'south'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'east') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'east'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'west') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'west'
            }));
            decrementStack(componentData.player);
        }
        componentData.cancel = true;
    }
}
export class longTable extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = componentData.dimension;
        const location = block.location;
        if (cardinal_direction == 'north' &&
            block.east().typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.east().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'south' &&
            block.west().typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.west().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'south'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'east' &&
            block.south().typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.south().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'east'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'west' &&
            block.north().typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.north().setPermutation(BlockPermutation.resolve('bf_dc:full', {
                'minecraft:cardinal_direction': 'west'
            }));
            decrementStack(componentData.player);
        }
        componentData.cancel = true;
    }
}
export class mailbox extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (block.above().typeId != 'minecraft:air')
            return;
        if (cardinal_direction == 'north') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:half_pillar', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:half_pillar', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'south') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:half_pillar', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:half_pillar', {
                'minecraft:cardinal_direction': 'south'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'east') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:half_pillar', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:half_pillar', {
                'minecraft:cardinal_direction': 'east'
            }));
            decrementStack(componentData.player);
        }
        else if (cardinal_direction == 'west') {
            dimension.runCommand(`execute positioned ${location.x} ${location.y} ${location.z} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:half_pillar', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.above().setPermutation(BlockPermutation.resolve('bf_dc:half_pillar', {
                'minecraft:cardinal_direction': 'west'
            }));
            decrementStack(componentData.player);
        }
        componentData.cancel = true;
    }
}
export class mediumTable extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        const cardinal_direction = componentData.permutationToPlace.getState('minecraft:cardinal_direction');
        const block = componentData.block;
        let blockToPlace = componentData.permutationToPlace;
        const dimension = block.dimension;
        const location = block.location;
        if (cardinal_direction == 'north' &&
            block.west().typeId == 'minecraft:air' &&
            block.south().typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 0, z: 1 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x + 0.5} ${location.y} ${location.z + 0.5} run summon ${blockToPlace.type.id} ~~~ ~180~ v1`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.west().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.south().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: -1, y: 0, z: 1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        else if (cardinal_direction == 'south' &&
            block.east().typeId == 'minecraft:air' &&
            block.north().typeId == 'minecraft:air' &&
            block.offset({ x: 1, y: 0, z: -1 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x + 0.5} ${location.y} ${location.z + 0.5} run summon ${blockToPlace.type.id} ~~~ ~~ v2`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.east().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.north().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'south'
            }));
            block.offset({ x: 1, y: 0, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'south'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        else if (cardinal_direction == 'east' &&
            block.north().typeId == 'minecraft:air' &&
            block.west().typeId == 'minecraft:air' &&
            block.offset({ x: -1, y: 0, z: -1 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x + 0.5} ${location.y} ${location.z + 0.5} run summon ${blockToPlace.type.id} ~~~ ~-90~ v4`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'east'
            }));
            block.north().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.west().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: -1, y: 0, z: -1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        else if (cardinal_direction == 'west' &&
            block.south().typeId == 'minecraft:air' &&
            block.east().typeId == 'minecraft:air' &&
            block.offset({ x: 1, y: 0, z: 1 }).typeId == 'minecraft:air') {
            dimension.runCommand(`execute positioned ${location.x + 0.5} ${location.y} ${location.z + 0.5} run summon ${blockToPlace.type.id} ~~~ ~90~ v3`);
            block.setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'west'
            }));
            block.south().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.east().setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            block.offset({ x: 1, y: 0, z: 1 }).setPermutation(BlockPermutation.resolve('bf_dc:null', {
                'minecraft:cardinal_direction': 'north'
            }));
            decrementStack(componentData.player);
            const tableEntities = block.dimension.getEntities({
                excludeTypes: ['minecraft:player'],
                location: block.location,
                closest: 1
            });
            for (const entity of tableEntities) {
                entity.setDynamicProperty('bf_dc:table_location', block.location);
            }
        }
        componentData.cancel = true;
    }
}
export class sofa extends beforeOnPlayerPlace {
    beforeOnPlayerPlace(componentData) {
        componentData.block.dimension
            .spawnEntity('bf_dc:sit', {
            x: componentData.block.location.x + 0.5,
            y: componentData.block.location.y + 0.4,
            z: componentData.block.location.z + 0.5
        })
            .addTag(`sofa`);
    }
}
