import { world, system } from "@minecraft/server";
import * as blockUtilities from "../utilities/block_utilities.js"

system.beforeEvents.startup.subscribe(({blockComponentRegistry}) => {
	blockComponentRegistry.registerCustomComponent("megaverse:alchemy_altar", AlchemyAltar);
	blockComponentRegistry.registerCustomComponent("megaverse:block_atelaiozoic_scarab_egg", BlockAtelaiozoicScarabEgg);
	blockComponentRegistry.registerCustomComponent("megaverse:block_cake", BlockCake);
	blockComponentRegistry.registerCustomComponent("megaverse:block_chair", BlockChair);
	blockComponentRegistry.registerCustomComponent("megaverse:block_coin_pile", BlockCoinPile);
	blockComponentRegistry.registerCustomComponent("megaverse:block_crop", BlockCrop);
	blockComponentRegistry.registerCustomComponent("megaverse:block_egg", BlockEgg);
	blockComponentRegistry.registerCustomComponent("megaverse:block_fire_dragon_egg", BlockFireDragonEgg);
	blockComponentRegistry.registerCustomComponent("megaverse:block_flower", BlockFlower);
	blockComponentRegistry.registerCustomComponent("megaverse:block_layer", BlockLayer);
	blockComponentRegistry.registerCustomComponent("megaverse:block_plant", BlockPlant);
	blockComponentRegistry.registerCustomComponent("megaverse:block_sapling", BlockSapling);
	blockComponentRegistry.registerCustomComponent("megaverse:block_small_shutter", BlockSmallShutter);
	blockComponentRegistry.registerCustomComponent("megaverse:block_trap_cover", BlockTrapCover);
	blockComponentRegistry.registerCustomComponent("megaverse:break_block_layer", BreakBlockLayer);
	blockComponentRegistry.registerCustomComponent("megaverse:break_firewood", BreakFirewood);
	blockComponentRegistry.registerCustomComponent("megaverse:break_fuel_can", BreakFuelCan);
	blockComponentRegistry.registerCustomComponent("megaverse:burnt_block", BurntBlock);
	blockComponentRegistry.registerCustomComponent("megaverse:cryothermalia", Cryothermalia);
	blockComponentRegistry.registerCustomComponent("megaverse:deer_skull", DeerSkull);
	//blockComponentRegistry.registerCustomComponent("megaverse:falling_block", FallingBlock);
	blockComponentRegistry.registerCustomComponent("megaverse:frost", Frost);
	blockComponentRegistry.registerCustomComponent("megaverse:frosted_block", FrostedBlock);
	blockComponentRegistry.registerCustomComponent("megaverse:great_velanidia_sapling", GreatVelanidiaSapling);
	blockComponentRegistry.registerCustomComponent("megaverse:ice_spikes", IceSpikes);
	blockComponentRegistry.registerCustomComponent("megaverse:interact_block_crop", InteractBlockCrop);
	blockComponentRegistry.registerCustomComponent("megaverse:interact_block_egg", InteractBlockEgg);
	blockComponentRegistry.registerCustomComponent("megaverse:interact_firewood", InteractFirewood);
	blockComponentRegistry.registerCustomComponent("megaverse:interact_fuel_can", InteractFuelCan);
	blockComponentRegistry.registerCustomComponent("megaverse:kindling_pile", KindlingPile);
	blockComponentRegistry.registerCustomComponent("megaverse:pyronella", Pyronella);
	blockComponentRegistry.registerCustomComponent("megaverse:random_tick_ice_spikes", RandomTickIceSpikes);
	blockComponentRegistry.registerCustomComponent("megaverse:sconce", Sconce);
	blockComponentRegistry.registerCustomComponent("megaverse:silkworm_cocoon", SilkwormCocoon);
	blockComponentRegistry.registerCustomComponent("megaverse:smoldering_block", SmolderingBlock);
	blockComponentRegistry.registerCustomComponent("megaverse:tick_block_egg", TickBlockEgg);
	blockComponentRegistry.registerCustomComponent("megaverse:tick_frosted_block", TickFrostedBlock);
	blockComponentRegistry.registerCustomComponent("megaverse:tick_smoldering_block", TickSmolderingBlock);
	blockComponentRegistry.registerCustomComponent("megaverse:tick_truffled_roots", TickTruffledRoots);
	blockComponentRegistry.registerCustomComponent("megaverse:truffled_dirt", TruffledDirt);
	blockComponentRegistry.registerCustomComponent("megaverse:truffled_roots", TruffledRoots);
});
const AlchemyAltar = {
	onPlayerInteract({block,dimension,face,player},{params}) {
		blockUtilities.alchemyAltar(block,dimension,face,player,params);
	},
	onTick({block,dimension},{params}) {
		blockUtilities.alchemyAltarTick(block,dimension,params);
	}
};
const BlockAtelaiozoicScarabEgg = {
	onPlayerBreak({block,brokenBlockPermutation,dimension,player},{params}) {
		blockUtilities.blockAtelaiozoicScarabEggBreak(block,brokenBlockPermutation,dimension,player,params);
	},
	onTick({block,dimension},{params}) {
		blockUtilities.blockAtelaiozoicScarabEggTick(block,dimension,params);
	}
};
const BlockCake = {
	onPlayerInteract({block,dimension,player},{params}) {
		blockUtilities.blockCake(block,dimension,player,params);
	}
};
const BlockChair = {
	onPlayerInteract({block,dimension,player}) {
		blockUtilities.blockChair(block,dimension,player);
	}
};
const BlockCoinPile = {
	onPlayerInteract({block,dimension,player},{params}) {
		blockUtilities.blockCoinPile(block,dimension,player,params);
	},
	onPlayerBreak({block,brokenBlockPermutation,dimension,player},{params}) {
		blockUtilities.blockCoinPileBreak(block,brokenBlockPermutation,dimension,player,params);
	}
};
const BlockCrop = {
	onPlayerInteract({block,dimension,player}) {
		blockUtilities.blockCropInteract(block,dimension,player);
	},
	onRandomTick({block,dimension}) {
		blockUtilities.blockCropRandomTick(block,dimension);
	}
};
const BlockEgg = {
	onEntityFallOn({block,dimension}) {
		blockUtilities.blockEggFallOn(block,dimension);
	},
	onPlayerBreak({block,brokenBlockPermutation,dimension,player}) {
		blockUtilities.blockEggBreak(block,brokenBlockPermutation,dimension,player);
	}
};
const BlockFireDragonEgg = {
	onPlayerBreak({block,brokenBlockPermutation,dimension,player},{params}) {
		blockUtilities.blockFireDragonEggBreak(block,brokenBlockPermutation,dimension,player,params);
	},
	onTick({block,dimension},{params}) {
		blockUtilities.blockFireDragonEggTick(block,dimension,params);
	}
};
const BlockFlower = {
	onPlayerInteract({block,dimension,player}) {
		blockUtilities.blockFlowerInteract(block,dimension,player);
	}
};
const BlockPlant = {
	onPlayerInteract({block,dimension,player}) {
		blockUtilities.blockPlantInteract(block,dimension,player);
	}
};
const BlockLayer = {
	onPlayerInteract({block,dimension,player},{params}) {
		blockUtilities.blockLayer(block,dimension,player,params);
	}
};
const BlockSapling = {
	onPlayerInteract({block,dimension,player}) {
		blockUtilities.blockSaplingInteract(block,dimension,player);
	},
	onRandomTick({block,dimension}) {
		blockUtilities.blockSaplingRandomTick(block,dimension);
	}
};
const BlockSmallShutter = {
	onPlayerInteract({block,dimension,player}) {
		blockUtilities.blockSmallShutterInteract(block,dimension,player);
	}
};

const BlockTrapCover = {
	onEntityFallOn({block,dimension}) {
		blockUtilities.blockTrapCoverFallOn(block,dimension);
	},
	onStepOn({block,dimension,entity}) {
		blockUtilities.blockTrapCoverStepOn(block,dimension,entity);
	}
};
const BreakBlockLayer = {
	onPlayerBreak({block,brokenBlockPermutation,dimension,player},{params}) {
		blockUtilities.blockLayerBreak(block,brokenBlockPermutation,dimension,player,params);
	}
};
const BreakFirewood = {
	onPlayerBreak({block,brokenBlockPermutation,dimension,player}) {
		blockUtilities.firewoodBreak(block,brokenBlockPermutation,dimension,player);
	}
};
const BreakFuelCan = {
	onPlayerBreak({block,brokenBlockPermutation,dimension,player}) {
		blockUtilities.fuelCanBreak(block,brokenBlockPermutation,dimension,player);
	}
};
const BurntBlock = {
	onRandomTick({block,dimension},{params}) {
		blockUtilities.burntBlockRandomTick(block,dimension,params);
	}
};
const Cryothermalia = {
	onRandomTick({block,dimension}) {
		blockUtilities.cryothermaliaRandomTick(block,dimension);
	},
	onTick({block,dimension}) {
		blockUtilities.cryothermaliaTick(block,dimension);
	}
};

const DeerSkull = {
	onPlayerInteract({block,dimension,face,player}) {
		blockUtilities.deerSkullInteract(block,dimension,face,player);
	},
	onPlayerBreak({block,brokenBlockPermutation,dimension,player}) {
		blockUtilities.deerSkullBreak(block,brokenBlockPermutation,dimension,player);
	}
};
const FallingBlock = {
	onTick({block,dimension},{params}) {
		//blockUtilities.fallingBlockTick(block,dimension,params);
	}
};
const Frost = {
	onRandomTick({block,dimension}) {
		blockUtilities.frostRandomTick(block,dimension);
	},
	onTick({block,dimension}) {
		blockUtilities.frostTick(block,dimension);
	}
};

const FrostedBlock = {
	onRandomTick({block,dimension}) {
		blockUtilities.frostedBlockRandomTick(block,dimension);
	}
};
const GreatVelanidiaSapling = {
	onPlayerInteract({block,dimension,player},{params}) {
		blockUtilities.greatVelanidiaSaplingInteract(block,dimension,player,params);
	},
	onRandomTick({block,dimension},{params}) {
		blockUtilities.greatVelanidiaSaplingRandomTick(block,dimension,params);
	}
};
const IceSpikes = {
	onEntityFallOn({block,dimension}) {
		blockUtilities.iceSpikesFallOn(block,dimension);
	},
	onStepOn({block,dimension,entity}) {
		blockUtilities.iceSpikesStepOn(block,dimension,entity);
	}
};

const InteractBlockCrop = {
	onPlayerInteract({block,dimension,player},{params}) {
		blockUtilities.blockCropInteract2(block,dimension,player,params);
	}
};
const InteractBlockEgg = {
	onPlayerInteract({block,dimension,player}) {
		blockUtilities.blockEggInteract(block,dimension,player);
	}
};
const InteractFirewood = {
	onPlayerInteract({block,dimension,player}) {
		blockUtilities.firewoodInteract(block,dimension,player);
	}
};
const InteractFuelCan = {
	onPlayerInteract({block,dimension,player}) {
		blockUtilities.fuelCanInteract(block,dimension,player);
	}
};
const KindlingPile = {
	onPlayerBreak({block,brokenBlockPermutation,dimension,player}) {
		blockUtilities.kindlingPileBreak(block,brokenBlockPermutation,dimension,player);
	},
	onPlayerInteract({block,dimension,player}) {
		blockUtilities.kindlingPileInteract(block,dimension,player);
	}
};
const Pyronella = {
	onRandomTick({block,dimension},{params}) {
		blockUtilities.pyronellaRandomTick(block,dimension,params);
	}
};
const RandomTickIceSpikes = {
	onRandomTick({block,dimension}) {
		blockUtilities.iceSpikesRandomTick(block,dimension);
	}
};
const Sconce = {
	onPlayerInteract({block,dimension,player}) {
		blockUtilities.sconceInteract(block,dimension,player);
	},
	onRandomTick({block,dimension}) {
		blockUtilities.sconceRandomTick(block,dimension);
	}
};
const SilkwormCocoon = {
	onTick({block,dimension}) {
		blockUtilities.silkwormCocoonTick(block,dimension);
	}
};
const SmolderingBlock = {
	onRandomTick({block,dimension},{params}) {
		blockUtilities.smolderingBlockRandomTick(block,dimension,params);
	}
};
const TickBlockEgg = {
	onTick({block,dimension}) {
		blockUtilities.blockEggTick(block,dimension);
	}
};
const TickFrostedBlock = {
	onTick({block,dimension}) {
		blockUtilities.frostedBlockTick(block,dimension);
	}
};
const TickSmolderingBlock = {
	onTick({block,dimension},{params}) {
		blockUtilities.smolderingBlockTick(block,dimension,params);
	}
};
const TickTruffledRoots = {
	onTick({block,dimension}) {
		blockUtilities.truffledRootsTick(block,dimension);
	}
};
const TruffledDirt = {
	onRandomTick({block,dimension}) {
		blockUtilities.truffledDirt(block,dimension);
	}
};
const TruffledRoots = {
	onRandomTick({block,dimension}) {
		blockUtilities.truffledRoots(block,dimension);
	}
};