Changes

77 bytes added ,  21:32, 27 June 2022
Fix lazy in multilingual examples
Line 226: Line 226:  
|kotlin=val EXAMPLE: DeferredRegister<ExampleRegistry> = DeferredRegister.create(ResourceLocation(MODID, "example_registry"), MODID)
 
|kotlin=val EXAMPLE: DeferredRegister<ExampleRegistry> = DeferredRegister.create(ResourceLocation(MODID, "example_registry"), MODID)
   −
val REGISTRY: IForgeRegistry<ExampleRegistry> by lazy {
+
val REGISTRY: IForgeRegistry<ExampleRegistry> by EXAMPLE.makeRegistry(::RegistryBuilder).let {
    EXAMPLE.makeRegistry(::RegistryBuilder).get()
+
    lazy {
 +
        it.get()
 +
    }
 
}
 
}
 
|scala=final val EXAMPLE = DeferredRegister.create(new ResourceLocation(MODID, "example_registry"), MODID)
 
|scala=final val EXAMPLE = DeferredRegister.create(new ResourceLocation(MODID, "example_registry"), MODID)
   −
final lazy val REGISTRY = EXAMPLE.makeRegistry(() => new RegistryBuilder).get
+
private final val PRIVATE_REGISTRY = EXAMPLE.makeRegistry(() => new RegistryBuilder)
 +
final lazy val REGISTRY = PRIVATE_REGISTRY.get
 
|}}
 
|}}