package ru.dbotthepony.mc.otm.capability;

import mekanism.api.energy.IStrictEnergyHandler;
import net.minecraftforge.common.capabilities.CapabilityManager;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityToken;
import net.minecraftforge.common.capabilities.RegisterCapabilitiesEvent;
import org.jetbrains.annotations.NotNull;
import ru.dbotthepony.mc.otm.capability.drive.IMatteryDrive;
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage;
import ru.dbotthepony.mc.otm.capability.matter.IMatterStorage;
import ru.dbotthepony.mc.otm.capability.matter.IReplicationTaskProvider;
import ru.dbotthepony.mc.otm.capability.matter.IPatternStorage;
import ru.dbotthepony.mc.otm.graph.matter.MatterNode;
import ru.dbotthepony.mc.otm.graph.storage.StorageNode;
import top.theillusivec4.curios.api.type.capability.ICurio;
import top.theillusivec4.curios.api.type.capability.ICuriosItemHandler;

import javax.annotation.Nonnull;

public class MatteryCapability {
	@Nonnull
	@NotNull
	public static final Capability<IMatteryEnergyStorage> ENERGY = CapabilityManager.get(new CapabilityToken<>() {});

	@Nonnull
	@NotNull
	public static final Capability<MatteryPlayerCapability> MATTERY_PLAYER = CapabilityManager.get(new CapabilityToken<>() {});

	@Nonnull
	@NotNull
	public static final Capability<IMatterStorage> MATTER = CapabilityManager.get(new CapabilityToken<>() {});

	@Nonnull
	@NotNull
	public static final Capability<MatterNode> MATTER_NODE = CapabilityManager.get(new CapabilityToken<>() {});

	@Nonnull
	@NotNull
	public static final Capability<IPatternStorage> PATTERN = CapabilityManager.get(new CapabilityToken<>() {});

	@Nonnull
	@NotNull
	public static final Capability<IReplicationTaskProvider> TASK = CapabilityManager.get(new CapabilityToken<>() {});

	@Nonnull
	@NotNull
	public static final Capability<IMatteryDrive> DRIVE = CapabilityManager.get(new CapabilityToken<>() {});

	@Nonnull
	@NotNull
	public static final Capability<StorageNode> STORAGE_NODE = CapabilityManager.get(new CapabilityToken<>() {});

	@Nonnull
	@NotNull
	public static final Capability<IStrictEnergyHandler> MEKANISM_ENERGY = CapabilityManager.get(new CapabilityToken<>() {});

	@Nonnull
	@NotNull
	public static final Capability<ICuriosItemHandler> CURIOS_INVENTORY = CapabilityManager.get(new CapabilityToken<>() {});

	@Nonnull
	@NotNull
	public static final Capability<ICurio> CURIOS_ITEM = CapabilityManager.get(new CapabilityToken<>() {});

	@Nonnull
	@NotNull
	public static final Capability<IMatteryUpgrade> UPGRADE = CapabilityManager.get(new CapabilityToken<>() {});

	public static void register(RegisterCapabilitiesEvent event) {
		event.register(IMatteryEnergyStorage.class);
		event.register(MatteryPlayerCapability.class);
		event.register(IMatterStorage.class);
		event.register(MatterNode.class);
		event.register(IPatternStorage.class);
		event.register(IReplicationTaskProvider.class);
		event.register(IMatteryDrive.class);
		event.register(StorageNode.class);
		event.register(IMatteryUpgrade.class);
	}
}
