aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorthedarkcolour <30441001+thedarkcolour@users.noreply.github.com>2019-11-11 15:00:00 -0800
committerthedarkcolour <30441001+thedarkcolour@users.noreply.github.com>2019-11-11 15:00:00 -0800
commit885e4f7e6a760943c5978204f8634057ad01a7db (patch)
tree70423f61fd84bce9dea0bf08d0d22638916c85aa /src
parentbf11f1cb96cfeb98a21025459f24f235ff06cd42 (diff)
downloadKotlinForForge-885e4f7e6a760943c5978204f8634057ad01a7db.tar.gz
KotlinForForge-885e4f7e6a760943c5978204f8634057ad01a7db.tar.bz2
KotlinForForge-885e4f7e6a760943c5978204f8634057ad01a7db.zip
Adding files
Diffstat (limited to 'src')
-rw-r--r--src/main/kotlin/thedarkcolour/kotlinforforge/registry/KtRegistryObject.kt3
1 files changed, 2 insertions, 1 deletions
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<T : IForgeRegistryEntry<T>>(private val name: ResourceLocation, private val registry: IForgeRegistry<T>) : Supplier<T> {
+open class KtRegistryObject<T : IForgeRegistryEntry<T>>(val name: ResourceLocation, registry: IForgeRegistry<T>) : Supplier<T> {
private lateinit var value: T
constructor(name: String, registry: IForgeRegistry<T>) : this(ResourceLocation(name), registry)
+ @Suppress("UNCHECKED_CAST")
constructor(name: String, registryType: Supplier<Class<out T>>) : this(ResourceLocation(name), RegistryManager.ACTIVE.getRegistry(registryType.get()) as IForgeRegistry<T>)
init {