This commit is contained in:
Gary Tierney
2019-07-18 02:44:35 +01:00
parent fe457d762a
commit 0b61e559fc
13 changed files with 321 additions and 27 deletions
+8 -1
View File
@@ -1 +1,8 @@
# What is a plugin?
# What is a plugin?
Plugins in Apollo are a mechanism for extending the server with new functionality without having to change any of the core Java code.
Every plugin is a straight forward Kotlin project with `.plugin.kts` files containing the plugin extension behaviour and optional Kotlin source files containing generic reusable code.
## Plugin framework architecture
Under the hood, the Kotlin compiler transofmrs every `.plugin.kts` file into a class file that extends from @"org.apollo.game.plugin.kotlin.KotlinPluginScript", giving it access to the game @"org.apollo.game.model.World" and @"org.apollo.game.message.handler.MessageHandlerChainSet" the plugin framework is initialized with.
@@ -10,17 +10,7 @@ branch prior to the release of the Kotlin plugin system for Apollo.
## Create a working environment
The project maintainers strongly recommend
[IntelliJ IDEA](https://www.jetbrains.com/idea/).
After starting IDEA, select *checkout project* with the URL:
https://github.com/apollo-rsps/apollo.git and continue. Make sure to
*import using gradle* on the next interface.
Next, checkout the kotlin-experiments branch. To do this via IntelliJ,
use the navigation bar at the top and 'VCS > Git > Branches >
origin/kotlin-experiments > Checkout as new branch'. Name the new branch
something like kotlin-experiments-my-plugin.
## Create the plugin metadata