Skip to content

Commit

Permalink
fix: use getters for injection in SubCommand
Browse files Browse the repository at this point in the history
fixes commands not working after /vreload
  • Loading branch information
Apehum committed Dec 6, 2024
1 parent b4caf95 commit d1fdebe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
- 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.
- `/vreload` command is now reloading the addon's config properly.
- Add [poToken](https://github.com/lavalink-devs/youtube-source?tab=readme-ov-file#using-a-potoken) support for YouTube source.
- Add [poToken](https://github.com/lavalink-devs/youtube-source?tab=readme-ov-file#using-a-potoken) support for YouTube source.
- Fixed discs commands not working properly after `/vreload`.
8 changes: 5 additions & 3 deletions core/src/main/kotlin/su/plo/voice/discs/command/SubCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ import su.plo.voice.discs.AddonConfig
import su.plo.voice.discs.AddonKeys
import su.plo.voice.discs.PlasmoAudioPlayerManager
import su.plo.voice.discs.utils.PluginKoinComponent
import su.plo.voice.discs.utils.extend.getValue
import su.plo.voice.discs.utils.extend.getter

abstract class SubCommand : PluginKoinComponent {

protected val voiceServer: PlasmoVoiceServer by inject()
protected val keys: AddonKeys by inject()
protected val config: AddonConfig by inject()
protected val audioPlayerManager: PlasmoAudioPlayerManager by inject()
protected val debugLogger: DebugLogger by inject()
protected val config: AddonConfig by getter()
protected val audioPlayerManager: PlasmoAudioPlayerManager by getter()
protected val debugLogger: DebugLogger by getter()

protected val scope = CoroutineScope(SupervisorJob() + Dispatchers.Default)

Expand Down

0 comments on commit d1fdebe

Please sign in to comment.