We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82df85b commit c4e0cebCopy full SHA for c4e0ceb
1 file changed
idofront-features/src/main/kotlin/com/mineinabyss/idofront/features/InjectHelpers.kt
@@ -35,13 +35,13 @@ import kotlin.io.path.div
35
inline fun <reified T : Any> MutableDI.singleConfig(
36
path: String,
37
crossinline configure: ConfigBuilder<T>.() -> Unit = {},
38
-) {
+): InjectedValue<T> {
39
val configHolder by single<SingleConfig<T>> {
40
val plugin = get<Plugin>()
41
config<T> { configure() }.single(plugin.dataPath / path)
42
}
43
var cache = configHolder.read() to Bukkit.getCurrentTick()
44
- factory<T> {
+ return factory<T> {
45
val currentTick = Bukkit.getCurrentTick()
46
val (data, lastRead) = cache
47
if (currentTick == lastRead) return@factory data
0 commit comments