-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use getter for injecting addon config
- Loading branch information
Showing
7 changed files
with
40 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
- Yet another lavaplayer update to fix playback issues. | ||
- Addons' permissions are now registered in Bukkit permissions. This resolves auto-complete and goat horns not working properly. | ||
- New config option `mono_sources` to use mono sources for playing the audio. | ||
- New config option `mono_sources` to use mono sources for playing the audio. | ||
- `/vreload` command is now reloading the addon's config properly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
core/src/main/kotlin/su/plo/voice/discs/utils/extend/KoinComponent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package su.plo.voice.discs.utils.extend | ||
|
||
import org.koin.core.component.KoinComponent | ||
import org.koin.core.component.get | ||
import kotlin.reflect.KProperty | ||
|
||
interface Getter<out T> { | ||
val value: T | ||
} | ||
|
||
inline operator fun <T> Getter<T>.getValue(thisRef: Any?, property: KProperty<*>): T = value | ||
|
||
inline fun <reified T : Any> KoinComponent.getter(): Getter<T> = | ||
object : Getter<T> { | ||
override val value: T | ||
get() = get() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters