Exception registering block with KDeferredRegister
michele-grifa opened this issue ยท 6 comments
Hi,
i downloaded the new 1.4.0 version of the library and in the SkeletonRepository i noticed the KDeferredRegister use, but when i try to convert my existing blocks to delegates, it show me the error:
kotlin.UninitializedPropertyAccessException: lateinit property value has not been initialized
From what I understand, the slab that refers to the planks, is initialized before the planks themselves.
The library don't register automatically the planks blocks the first time i request it?
Thanks
val blocks = KDeferredRegister(ForgeRegistries.BLOCKS, MoreStuffMod.MODID)
val japCherryPlanks by blocks.register("jap_cherry_planks") {
Block(AbstractBlock.Properties.create(Material.WOOD, MaterialColor.WOOD).hardnessAndResistance(2.0f, 3.0f).sound(SoundType.WOOD))
}
val japCherrySlab by blocks.register("jap_cherry_slab") { SlabBlock(AbstractBlock.Properties.from(japCherryPlanks)) }