package ru.dbotthepony.mc.otm.config

import net.minecraftforge.common.ForgeConfigSpec
import kotlin.reflect.KProperty

operator fun <T> ForgeConfigSpec.ConfigValue<T>.setValue(config: Any, property: KProperty<*>, value: T) {
	set(value)
}

operator fun <T : Any> ForgeConfigSpec.ConfigValue<T>.getValue(config: Any, property: KProperty<*>): T {
	return get()
}

fun ForgeConfigSpec.Builder.defineInRange(path: String, value: Int, minValue: Int): ForgeConfigSpec.IntValue {
	return defineInRange(path, value, minValue, Int.MAX_VALUE)
}

fun ForgeConfigSpec.Builder.defineInRange(path: String, value: Double, minValue: Double): ForgeConfigSpec.DoubleValue {
	return defineInRange(path, value, minValue, Double.MAX_VALUE)
}
