package net.pietru.omni_power;

import finalforeach.cosmicreach.blockevents.BlockEvents;
import finalforeach.cosmicreach.blocks.Block;
import net.pietru.omni_power.blockevents.Power;
import dev.crmodders.cosmicquilt.api.entrypoint.ModInitializer;
import org.quiltmc.loader.api.ModContainer;

public class OmniPower implements ModInitializer {
	public static final String MOD_ID = "omni_power";
	public static boolean block_entities = false;
	public static final String[] blocks = {
			"cable",
			"lever",
			"door_cube",
			"cable_merger",
			"cable_adapter"
	};
	@Override
	public void onInitialize(ModContainer mod) {
		//if (QuiltLoader.isModLoaded("becraft"))
		System.out.println("OmniPower Mod Initialized!");

		load_power_event();
		block_entities=true;

		System.out.println("Registered OmniPower Events");

		for (String block:blocks) {
			System.out.println(block);
			Block.getInstance("omni_power/"+block);
		}

		System.out.println("Registered OmniPower Blocks");
	}

	public static void load_power_event(){
		try {
			BlockEvents.registerBlockEventAction(Power.class);
		} catch (Exception e){
			System.out.println(e);
			System.out.println("If msg above says something Duplicate block event action key it might be intended behaviour...");
		}
	}
}

