package ru.dbotthepony.mc.otm.compat.jade

import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.entity.BlockEntity
import ru.dbotthepony.mc.otm.block.MatteryBlock
import ru.dbotthepony.mc.otm.block.entity.MatteryWorkerBlockEntity
import ru.dbotthepony.mc.otm.block.entity.matter.MatterBottlerBlockEntity
import ru.dbotthepony.mc.otm.block.entity.matter.MatterReconstructorBlockEntity
import ru.dbotthepony.mc.otm.block.entity.matter.MatterReplicatorBlockEntity
import ru.dbotthepony.mc.otm.block.entity.matter.MatterScannerBlockEntity
import ru.dbotthepony.mc.otm.block.matter.MatterBottlerBlock
import ru.dbotthepony.mc.otm.block.matter.MatterReconstructorBlock
import ru.dbotthepony.mc.otm.block.matter.MatterReplicatorBlock
import ru.dbotthepony.mc.otm.block.matter.MatterScannerBlock
import ru.dbotthepony.mc.otm.compat.jade.providers.*
import snownee.jade.api.IWailaClientRegistration
import snownee.jade.api.IWailaCommonRegistration
import snownee.jade.api.IWailaPlugin
import snownee.jade.api.WailaPlugin

@WailaPlugin
class JadePlugin : IWailaPlugin {
	override fun register(reg: IWailaCommonRegistration) {
		reg.registerBlockDataProvider(MatterStorageProvider, BlockEntity::class.java)
		reg.registerBlockDataProvider(MatteryEnergyProvider, BlockEntity::class.java)
		reg.registerBlockDataProvider(MatteryWorkerProvider, MatteryWorkerBlockEntity::class.java)
		reg.registerBlockDataProvider(MatterBottlerProvider, MatterBottlerBlockEntity::class.java)
		reg.registerBlockDataProvider(MatterReconstructorProvider, MatterReconstructorBlockEntity::class.java)
	}

	override fun registerClient(reg: IWailaClientRegistration) {
		reg.registerBlockComponent(MatteryEnergyProvider, Block::class.java)
		reg.registerBlockComponent(MatterStorageProvider, Block::class.java)
		reg.registerBlockComponent(MatteryWorkerProvider, MatteryBlock::class.java)
		reg.registerBlockComponent(MatterBottlerProvider, MatterBottlerBlock::class.java)
		reg.registerBlockComponent(MatterReconstructorProvider, MatterReconstructorBlock::class.java)
	}
}
