import { world, system } from "@minecraft/server";
import ItemDurability from './ItemDurability.js';
import ZombieSlapper from './ZombieSlapper.js';
import BarbedWire from './BarbedWire.js';
import PotatoLauncher from './PotatoLauncher.js';
import SlimeSlingshot from './SlimeSlingshot.js';
import FryingPan from './FryingPan.js';
import Flashlight from "./Flashlight.js";
import CustomLight from "./CustomLight.js";
import "./Wood/_corrupted_woodset.js";
import CaveRoot from "./CaveRoot.js";
import CorruptionMaker from "./CorruptionMaker.js";
import CaveCorruptionMaker from "./CaveCorruptionMaker.js";
import OpenMenu from "./OpenMenu.js";

world.beforeEvents.worldInitialize.subscribe(({ blockComponentRegistry, itemComponentRegistry }) => {
    itemComponentRegistry.registerCustomComponent("lv_zo:item_durability", ItemDurability);
    itemComponentRegistry.registerCustomComponent("lv_zo:zombie_slapper", ZombieSlapper);
    itemComponentRegistry.registerCustomComponent("lv_zo:potato_launcher", PotatoLauncher);
    itemComponentRegistry.registerCustomComponent("lv_zo:slimy_slingshot", SlimeSlingshot);
    itemComponentRegistry.registerCustomComponent("lv_zo:frying_pan", FryingPan);
    itemComponentRegistry.registerCustomComponent("lv_zo:flashlight", Flashlight);
    itemComponentRegistry.registerCustomComponent("lv_zo:open_menu", OpenMenu);
    blockComponentRegistry.registerCustomComponent("lv_zo:barbed_wire", BarbedWire);
    blockComponentRegistry.registerCustomComponent("lv_zo:custom_light", CustomLight);
    blockComponentRegistry.registerCustomComponent("lv_zo:cave_root", CaveRoot);
    blockComponentRegistry.registerCustomComponent("lv_zo:corruption_maker", CorruptionMaker);
    blockComponentRegistry.registerCustomComponent("lv_zo:cave_corruption_maker", CaveCorruptionMaker);
});