import { world, ItemStack } from "@minecraft/server";
const overworld = world.getDimension("overworld");
const buildConfirmationEntitiesEqo = {
    families: ["preview_entity"],
    excludeFamilies: ["preview_entity_confirmed"]
};
function getOneItemStackOfType(id) {
    return new ItemStack(id, 1);
}
function actionbarHint_BuildReady(entity) {
    entity.runCommand('title @a[r=15] actionbar §aInteract: §lConfirm Build§r §7| §eKill: §lCancel Build');
}
function actionbarHint_BuildConfirmed(entity) {
    entity.runCommand('title @a[r=8] actionbar §bFacility Build Confirmed!');
}
function actionbarHint_BuildCanceled(entity) {
    entity.runCommand('title @a[r=8] actionbar §eFacility Build Canceled.');
}
function actionbarHint_BuildFailed(entity) {
    entity.runCommand('title @a[r=8] actionbar §cSomething went wrong: Facility Build Failed!');
}
export function showBuildConfirmationGuide() {
    const buildConfirmationEntities = overworld.getEntities(buildConfirmationEntitiesEqo);
    buildConfirmationEntities.forEach((entity) => {
        actionbarHint_BuildReady(entity);
    });
}
world.afterEvents.entityDie.subscribe((eventData) => {
    try {
        const deadEntity = eventData.deadEntity;
        // SCP-002
        if (deadEntity.typeId == "lc:dtr_preview_scp002_facility") {
            if (deadEntity.hasComponent("minecraft:is_sheared")) {
                deadEntity.runCommand("structure load dtr_scpfacility:scp002 ~ ~ ~");
                actionbarHint_BuildConfirmed(deadEntity);
            }
            else {
                overworld.spawnItem(getOneItemStackOfType("lc:dtr_scpdocument_scp002"), deadEntity.location);
                actionbarHint_BuildCanceled(deadEntity);
            }
        }
        // SCP-005
        if (deadEntity.typeId == "lc:dtr_preview_scp005_facility") {
            if (deadEntity.hasComponent("minecraft:is_sheared")) {
                deadEntity.runCommand("structure load dtr_scpfacility:scp005 ~ ~ ~");
                actionbarHint_BuildConfirmed(deadEntity);
            }
            else {
                overworld.spawnItem(getOneItemStackOfType("lc:dtr_scpdocument_scp005"), deadEntity.location);
                actionbarHint_BuildCanceled(deadEntity);
            }
        }
        // SCP-008
        if (deadEntity.typeId == "lc:dtr_preview_scp008_facility") {
            if (deadEntity.hasComponent("minecraft:is_sheared")) {
                deadEntity.runCommand("structure load dtr_scpfacility:scp008 ~ ~ ~");
                actionbarHint_BuildConfirmed(deadEntity);
            }
            else {
                overworld.spawnItem(getOneItemStackOfType("lc:dtr_scpdocument_scp008"), deadEntity.location);
                actionbarHint_BuildCanceled(deadEntity);
            }
        }
        // SCP-012
        if (deadEntity.typeId == "lc:dtr_preview_scp012_facility") {
            if (deadEntity.hasComponent("minecraft:is_sheared")) {
                deadEntity.runCommand("structure load dtr_scpfacility:scp012 ~ ~ ~");
                actionbarHint_BuildConfirmed(deadEntity);
            }
            else {
                overworld.spawnItem(getOneItemStackOfType("lc:dtr_scpdocument_scp012"), deadEntity.location);
                actionbarHint_BuildCanceled(deadEntity);
            }
        }
        // SCP-049
        if (deadEntity.typeId == "lc:dtr_preview_scp049_facility") {
            if (deadEntity.hasComponent("minecraft:is_sheared")) {
                deadEntity.runCommand("structure load dtr_scpfacility:scp049 ~ ~ ~");
                actionbarHint_BuildConfirmed(deadEntity);
            }
            else {
                overworld.spawnItem(getOneItemStackOfType("lc:dtr_scpdocument_scp049"), deadEntity.location);
                actionbarHint_BuildCanceled(deadEntity);
            }
        }
        // SCP-096
        if (deadEntity.typeId == "lc:dtr_preview_scp096_facility") {
            if (deadEntity.hasComponent("minecraft:is_sheared")) {
                deadEntity.runCommand("structure load dtr_scpfacility:scp096 ~ ~ ~");
                actionbarHint_BuildConfirmed(deadEntity);
            }
            else {
                overworld.spawnItem(getOneItemStackOfType("lc:dtr_scpdocument_scp096"), deadEntity.location);
                actionbarHint_BuildCanceled(deadEntity);
            }
        }
        // SCP-173
        if (deadEntity.typeId == "lc:dtr_preview_scp173_facility") {
            if (deadEntity.hasComponent("minecraft:is_sheared")) {
                deadEntity.runCommand("structure load dtr_scpfacility:scp173 ~ ~ ~");
                actionbarHint_BuildConfirmed(deadEntity);
            }
            else {
                overworld.spawnItem(getOneItemStackOfType("lc:dtr_scpdocument_scp173"), deadEntity.location);
                actionbarHint_BuildCanceled(deadEntity);
            }
        }
// SCP-106
if (deadEntity.typeId == "lc:dtr_preview_scp106_facility") {
    if (deadEntity.hasComponent("minecraft:is_sheared")) {
        deadEntity.runCommand("structure load dtr_scpfacility:scp106 ~ ~ ~");
        actionbarHint_BuildConfirmed(deadEntity);
    }
    else {
        overworld.spawnItem(getOneItemStackOfType("lc:dtr_scpdocument_scp106"), deadEntity.location);
        actionbarHint_BuildCanceled(deadEntity);
    }
}
// SCP-131
if (deadEntity.typeId == "lc:dtr_preview_scp131_facility") {
    if (deadEntity.hasComponent("minecraft:is_sheared")) {
        deadEntity.runCommand("structure load dtr_scpfacility:scp131 ~ ~ ~");
        actionbarHint_BuildConfirmed(deadEntity);
    }
    else {
        overworld.spawnItem(getOneItemStackOfType("lc:dtr_scpdocument_scp131"), deadEntity.location);
        actionbarHint_BuildCanceled(deadEntity);
    }
}
// SCP-330
if (deadEntity.typeId == "lc:dtr_preview_scp330_facility") {
    if (deadEntity.hasComponent("minecraft:is_sheared")) {
        deadEntity.runCommand("structure load dtr_scpfacility:scp330 ~ ~ ~");
        actionbarHint_BuildConfirmed(deadEntity);
    }
    else {
        overworld.spawnItem(getOneItemStackOfType("lc:dtr_scpdocument_scp330"), deadEntity.location);
        actionbarHint_BuildCanceled(deadEntity);
    }
}
// SCP-513
if (deadEntity.typeId == "lc:dtr_preview_scp513_facility") {
    if (deadEntity.hasComponent("minecraft:is_sheared")) {
        deadEntity.runCommand("structure load dtr_scpfacility:scp513 ~ ~ ~");
        actionbarHint_BuildConfirmed(deadEntity);
    }
    else {
        overworld.spawnItem(getOneItemStackOfType("lc:dtr_scpdocument_scp513"), deadEntity.location);
        actionbarHint_BuildCanceled(deadEntity);
    }
}
// SCP-682
if (deadEntity.typeId == "lc:dtr_preview_scp682_facility") {
    if (deadEntity.hasComponent("minecraft:is_sheared")) {
        deadEntity.runCommand("structure load dtr_scpfacility:scp682 ~ ~ ~");
        actionbarHint_BuildConfirmed(deadEntity);
    }
    else {
        overworld.spawnItem(getOneItemStackOfType("lc:dtr_scpdocument_scp682"), deadEntity.location);
        actionbarHint_BuildCanceled(deadEntity);
    }
}
// SCP-939
if (deadEntity.typeId == "lc:dtr_preview_scp939_facility") {
    if (deadEntity.hasComponent("minecraft:is_sheared")) {
        deadEntity.runCommand("structure load dtr_scpfacility:scp939 ~ ~ ~");
        actionbarHint_BuildConfirmed(deadEntity);
    }
    else {
        overworld.spawnItem(getOneItemStackOfType("lc:dtr_scpdocument_scp939"), deadEntity.location);
        actionbarHint_BuildCanceled(deadEntity);
    }
}
// SCP-999
if (deadEntity.typeId == "lc:dtr_preview_scp999_facility") {
    if (deadEntity.hasComponent("minecraft:is_sheared")) {
        deadEntity.runCommand("structure load dtr_scpfacility:scp999 ~ ~ ~");
        actionbarHint_BuildConfirmed(deadEntity);
    }
    else {
        overworld.spawnItem(getOneItemStackOfType("lc:dtr_scpdocument_scp999"), deadEntity.location);
        actionbarHint_BuildCanceled(deadEntity);
    }
}
// SCP-207
if (deadEntity.typeId == "lc:dtr_preview_scp207_facility") {
    if (deadEntity.hasComponent("minecraft:is_sheared")) {
        deadEntity.runCommand("structure load dtr_scpfacility:scp207 ~ ~ ~");
        actionbarHint_BuildConfirmed(deadEntity);
    }
    else {
        overworld.spawnItem(getOneItemStackOfType("lc:dtr_scpdocument_scp207"), deadEntity.location);
        actionbarHint_BuildCanceled(deadEntity);
    }
}
// SCP-1048
if (deadEntity.typeId == "lc:dtr_preview_scp1048_facility") {
    if (deadEntity.hasComponent("minecraft:is_sheared")) {
        deadEntity.runCommand("structure load dtr_scpfacility:scp1048 ~ ~ ~");
        actionbarHint_BuildConfirmed(deadEntity);
    }
    else {
        overworld.spawnItem(getOneItemStackOfType("lc:dtr_scpdocument_scp1048"), deadEntity.location);
        actionbarHint_BuildCanceled(deadEntity);
    }
}
// SCP-500
if (deadEntity.typeId == "lc:dtr_preview_scp500_facility") {
    if (deadEntity.hasComponent("minecraft:is_sheared")) {
        deadEntity.runCommand("structure load dtr_scpfacility:scp500 ~ ~ ~");
        actionbarHint_BuildConfirmed(deadEntity);
    }
    else {
        overworld.spawnItem(getOneItemStackOfType("lc:dtr_scpdocument_scp500"), deadEntity.location);
        actionbarHint_BuildCanceled(deadEntity);
    }
}
// SCP-458
if (deadEntity.typeId == "lc:dtr_preview_scp458_facility") {
    if (deadEntity.hasComponent("minecraft:is_sheared")) {
        deadEntity.runCommand("structure load dtr_scpfacility:scp458 ~ ~ ~");
        actionbarHint_BuildConfirmed(deadEntity);
    }
    else {
        overworld.spawnItem(getOneItemStackOfType("lc:dtr_scpdocument_scp458"), deadEntity.location);
        actionbarHint_BuildCanceled(deadEntity);
    }
}
// >> DEVHELPER_PLACEHOLDER::SCRIPT_BLOCK_OF_NEW_FACILITY_PREVIEW
    }
    catch (ex) { }
});

//# sourceMappingURL=../../../_scpdtr_scriptingDebug/scpdtr/facility_preview.js.map
