mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-06 16:51:37 +00:00
Add door support in Kotlin (#356)
Adds support for doors as a Kotlin plugin, based on the previous ruby plugin by shiver.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
|
||||
import org.apollo.game.message.impl.ObjectActionMessage
|
||||
import org.apollo.plugin.navigation.door.Door
|
||||
import org.apollo.plugin.navigation.door.OpenDoorAction
|
||||
|
||||
/**
|
||||
* Hook into the [ObjectActionMessage] and listens for a supported door [GameObject]
|
||||
*/
|
||||
on { ObjectActionMessage::class }
|
||||
.where { option == 1 }
|
||||
.then {
|
||||
val door = Door.find(it.world, position, id) ?: return@then
|
||||
if (door.supported()) {
|
||||
OpenDoorAction.start(this, it, door, position)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user