-
-
Save Proximyst/93d20b780c3d8c788cec837d4af56e7a to your computer and use it in GitHub Desktop.
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
class PluginImpl : JavaPlugin() { | |
override fun onLoad() { instance = this } | |
companion object { | |
lateinit var instance : PluginImpl | |
private set | |
} | |
} |
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
class PluginImpl : JavaPlugin() { | |
companion object { | |
val instance by lazy { | |
JavaPlugin.getPlugin(PluginImpl::class.java)!! | |
} | |
} | |
} |
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
// Only possible in Kotlin 1.2 | |
lateinit var main : PluginImpl | |
class PluginImpl : JavaPlugin() { | |
override fun onLoad() { main = this } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment