From 885e4f7e6a760943c5978204f8634057ad01a7db Mon Sep 17 00:00:00 2001 From: thedarkcolour <30441001+thedarkcolour@users.noreply.github.com> Date: Mon, 11 Nov 2019 15:00:00 -0800 Subject: Adding files --- .../kotlin/thedarkcolour/kotlinforforge/registry/KtRegistryObject.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin') diff --git a/src/main/kotlin/thedarkcolour/kotlinforforge/registry/KtRegistryObject.kt b/src/main/kotlin/thedarkcolour/kotlinforforge/registry/KtRegistryObject.kt index 0b44705..fe20cc4 100644 --- a/src/main/kotlin/thedarkcolour/kotlinforforge/registry/KtRegistryObject.kt +++ b/src/main/kotlin/thedarkcolour/kotlinforforge/registry/KtRegistryObject.kt @@ -10,11 +10,12 @@ import java.util.function.Supplier /** * An alternative to DeferredRegistry that enforces non-nullability. */ -open class KtRegistryObject>(private val name: ResourceLocation, private val registry: IForgeRegistry) : Supplier { +open class KtRegistryObject>(val name: ResourceLocation, registry: IForgeRegistry) : Supplier { private lateinit var value: T constructor(name: String, registry: IForgeRegistry) : this(ResourceLocation(name), registry) + @Suppress("UNCHECKED_CAST") constructor(name: String, registryType: Supplier>) : this(ResourceLocation(name), RegistryManager.ACTIVE.getRegistry(registryType.get()) as IForgeRegistry) init { -- cgit