import { Direction } from "@minecraft/server";
import "./reg/suppComponents";
import "./content/goldDoorStuff";
import "./content/globeStuff";
import "./content/clockStuff";
import "./content/ashStuff";
import "./content/flintBlockStuff";
import "./content/ramBlockStuff";
import "./content/pumiceStuff";
import "./content/rakedGravelStuff";
import "./worldProxy";
import "./content/bookPileStuff";
import "./fallingBlocksManager";
import "./content/urnStuff";
import "./content/wallLanternStuff";
import "./content/soapStuff";
import "./content/endStoneLampStuff";
import "./content/cheeseStuff";
import "./content/stairsStuff";
import "./projectilesManager";
import "./content/presentsStuff";
import "./content/slingshotStuff";
import "./layersManager";
import "./content/pancakeStuff";
import "./content/sconceStuff";
import "./suppEventHandler";
import "./content/bambooSpikesStuff";
import "./content/jarStuff";
import "./blockEntitiesManager";
import "./content/hatStandStuff";
import "./content/ironGateStuff";
import "./content/stickStuff";
import "./content/bubbleBlowerStuff";
import "./content/chocolateStuff";
import "./content/candyStuff";
import "./configs";
import "./guideBook";
import "./util/blockProperties";
import "./content/chalkStuff";
import "./content/bombStuff";
import "./content/featherBlockStuff";
import { suppEvents } from "./suppEventHandler";
import { SuppTags } from "./reg/suppTags";
import { breakBlock } from "./util/miscUtils";
import { getSupportDirection } from "./util/placementUtils";
export function addonId() {
    return "razz_sup";
}
export function addonRes(path) {
    return res(addonId(), path);
}
export function res(namespace, path) {
    return namespace + ":" + path;
}
suppEvents.subscribeOnNeighborChanged((event) => {
    const block = event.block;
    let dir;
    if (block.hasTag(SuppTags.NeedsSolidBehind)) {
        dir = getSupportDirection(block.permutation);
    }
    else if (block.hasTag(SuppTags.NeedsSolidBelow)) {
        dir = Direction.Down;
    }
    if (dir == event.fromDir && event.neighborBlock.isAir) {
        breakBlock(block);
    }
});
/*
world.beforeEvents.playerInteractWithBlock.subscribe((event) => {
    const item = event.itemStack;
    if (item && item.typeId == McItems.Stick && event.isFirstEvent) {
        let block = event.block;
        console.log("--------------" + block.typeId + "--------------")
        console.log("Is UnPushable: " + isUnPushable(block));
        console.log("Can Piston Break: " + breakWhenPushed(block));
        console.log("Requires Solid Block Behind: " + needsSolidBlockBehind(block.permutation));
        console.log("Requires Solid Block Below: " + needsSolidBlockBelow(block.permutation));
        console.log("IsMultiBlock: " + isMultiBlock(block.typeId));
        console.log("Is DoubleBlock: " + isDoubleBlock(block.typeId));
        console.log("Direction: " + getADirection(block));
        console.log("Has Block Entity: " + (blockEntityManager.getExistingBlockEntityAt(block) != undefined));
        printAllStates(block);
        printAllTags(block);
        const item = getItemOfBlock(block);
        if (!item) return
        console.log("------ item ------");
        printAllTags(item);

    }
});*/ 
