import { world, system } from "@minecraft/server";
export default class PlotManager {
    static ProcessPlots() {
        let commands = [];
        commands.push("/execute as @a run gamerule sendcommandfeedback false");
        commands = commands.concat(this.ProcessBook());
        commands = commands.concat(this.ProcessBuildings());
        commands = commands.concat(this.ProcessEntrances());
        commands = commands.concat(this.ProcessHubs());
        commands = commands.concat(this.ProcessCorridors());
        commands = commands.concat(this.ProcessRooms());
        commands.push("/tp @a -160 -33 80");
        commands.push("/execute as @a run gamerule sendcommandfeedback true");
        let dimenion = world.getDimension("overworld");
        let run_number = system.runInterval(() => {
            let command = commands.shift();
            if (command) {
                dimenion.runCommand(`/say ${command}`);
                dimenion.runCommand(command);
            }
            if (commands.length == 0) {
                system.clearRun(run_number);
            }
        }, 10);
    }
    static ProcessBook() {
        let commands = [];
        commands.push(`/say --- Processing Book ---`);
        commands.push("/tp @a -192 -48 80 -90 0");
        commands.push("/kill @e[type=item]");
        commands.push("/clone -177 -48 80 -177 -48 80 -178 -48 80 replace normal");
        commands.push("/setblock -178 -48 80 air destroy");
        commands.push('/kill @e[type=item,name=!"Security++"]');
        commands.push('/execute as @e[name="Security++"] run tp @s -179 -48 80');
        commands.push(`/structure save 57d_sbunk:book_void -179 -48 80 -179 -48 80 disk`);
        commands.push(`/structure-export 57d_sbunk:book_void`);
        commands.push(`/structure delete 57d_sbunk:book_void`);
        commands.push("/kill @e[type=item]");
        return commands;
    }
    static ProcessBuildings() {
        let commands = [];
        commands.push(`/say --- Processing Buildings ---`);
        commands.push("/tp @a -160 -36 80");
        commands.push(`/structure save 57d_sbunk:building_0 -160 -48 80 -145 -36 95 disk`);
        commands.push(`/structure-export 57d_sbunk:building_0`);
        commands.push(`/structure delete 57d_sbunk:building_0`);
        commands.push("/tp @a -160 -36 112");
        commands.push(`/structure save 57d_sbunk:building_1 -160 -48 112 -145 -36 127 disk`);
        commands.push(`/structure-export 57d_sbunk:building_1`);
        commands.push(`/structure delete 57d_sbunk:building_1`);
        commands.push("/tp @a -160 -36 144");
        commands.push(`/structure save 57d_sbunk:building_2 -160 -48 144 -145 -36 159 disk`);
        commands.push(`/structure-export 57d_sbunk:building_2`);
        commands.push(`/structure delete 57d_sbunk:building_2`);
        commands.push("/tp @a -160 -36 176");
        commands.push(`/structure save 57d_sbunk:building_3 -160 -48 176 -145 -36 191 disk`);
        commands.push(`/structure-export 57d_sbunk:building_3`);
        commands.push(`/structure delete 57d_sbunk:building_3`);
        commands.push("/tp @a -160 -36 208");
        commands.push(`/structure save 57d_sbunk:building_4 -160 -48 208 -145 -36 223 disk`);
        commands.push(`/structure-export 57d_sbunk:building_4`);
        commands.push(`/structure delete 57d_sbunk:building_4`);
        commands.push("/tp @a -160 -36 240");
        commands.push(`/structure save 57d_sbunk:building_5 -160 -48 240 -145 -36 255 disk`);
        commands.push(`/structure-export 57d_sbunk:building_5`);
        commands.push(`/structure delete 57d_sbunk:building_5`);
        commands.push("/tp @a -160 -36 272");
        commands.push(`/structure save 57d_sbunk:building_6 -160 -48 272 -145 -36 287 disk`);
        commands.push(`/structure-export 57d_sbunk:building_6`);
        commands.push(`/structure delete 57d_sbunk:building_6`);
        return commands;
    }
    static ProcessEntrances() {
        let commands = [];
        commands.push(`/say --- Processing Entrances ---`);
        commands.push("/tp @a -128 -33 80");
        commands.push(`/structure save 57d_sbunk:entrance_0 -128 -48 80 -113 -40 95 disk`);
        commands.push(`/structure-export 57d_sbunk:entrance_0`);
        commands.push(`/structure delete 57d_sbunk:entrance_0`);
        return commands;
    }
    static ProcessHubs() {
        let commands = [];
        commands.push(`/say --- Processing Buildings ---`);
        commands.push("/tp @a -96 -33 80");
        commands.push(`/structure save 57d_sbunk:hub_0 -96 -48 80 -49 -33 127 disk`);
        commands.push(`/structure-export 57d_sbunk:hub_0`);
        commands.push(`/structure delete 57d_sbunk:hub_0`);
        return commands;
    }
    static ProcessCorridors() {
        let commands = [];
        commands.push(`/say --- Processing Corridors ---`);
        commands.push("/tp @a -32 -33 80");
        commands.push(`/structure save 57d_sbunk:corridor_0 -32 -48 80 -17 -38 127 disk`);
        commands.push(`/structure-export 57d_sbunk:corridor_0`);
        commands.push(`/structure delete 57d_sbunk:corridor_0`);
        commands.push("/tp @a -32 -48 144");
        commands.push(`/structure save 57d_sbunk:corridor_1 -32 -48 144 -17 -38 175 disk`);
        commands.push(`/structure-export 57d_sbunk:corridor_1`);
        commands.push(`/structure delete 57d_sbunk:corridor_1`);
        return commands;
    }
    static ProcessRooms() {
        let category_count = 4;
        let room_count = 0;
        let size = { x: 32, y: 16, z: 32 };
        let start = { x: 0, y: -48, z: 80 };
        let room_padding = { x: 0, y: 0, z: 16 };
        let category_padding = { x: 16, y: 0, z: 0 };
        let commands = [];
        for (let i = 0; i < category_count; i++) {
            if (i === 0) {
                room_count = 13;
            }
            else if (i === 1) {
                room_count = 12;
            }
            else if (i === 2) {
                room_count = 4;
            }
            else if (i === 3) {
                room_count = 6;
            }
            world.getDimension("overworld").runCommand(`say --- Category ${i} ---`);
            for (let j = 0; j < room_count; j++) {
                let structure_location = { x: start.x + i * size.x + i * category_padding.x, y: start.y, z: start.z + j * size.z + j * room_padding.z };
                let structure_name = `room_${i}_${j}`;
                let command_save = `/structure save 57d_sbunk:${structure_name} ${structure_location.x} ${structure_location.y} ${structure_location.z} ${structure_location.x + (size.x - 1)} ${structure_location.y + (size.y - 1)} ${structure_location.z + (size.z - 1)} disk`;
                let command_export = `/structure-export 57d_sbunk:${structure_name}`;
                let command_delete = `/structure delete 57d_sbunk:${structure_name}`;
                let command_teleport = `/tp @a ${structure_location.x} ${structure_location.y + size.y} ${structure_location.z}`;
                commands.push(command_teleport);
                commands.push(command_save);
                commands.push(command_export);
                commands.push(command_delete);
            }
        }
        return commands;
    }
}

//# sourceMappingURL=../../../_SBUNK_BPDebug/fs_sbunk/PlotManager.js.map
