package ru.dbotthepony.mc.otm.registry

import net.minecraft.commands.synchronization.ArgumentTypeInfo
import net.minecraft.commands.synchronization.ArgumentTypeInfos
import net.minecraft.commands.synchronization.SingletonArgumentInfo
import net.minecraft.core.registries.Registries
import net.neoforged.bus.api.IEventBus
import ru.dbotthepony.mc.otm.server.command.AndroidResearchArgument

object CommandArgumentTypes {
	private val registry: MDeferredRegister<ArgumentTypeInfo<*, *>> = MDeferredRegister(Registries.COMMAND_ARGUMENT_TYPE)

	val ANDROID_RESEARCH by registry.register("android_research") {
		ArgumentTypeInfos.registerByClass(AndroidResearchArgument::class.java, SingletonArgumentInfo.contextFree(AndroidResearchArgument.Companion::create))
	}

	fun register(bus: IEventBus) {
		registry.register(bus)
	}
}
