mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-04 08:39:27 +00:00
1c8bc3a009
Adds support for doors as a Kotlin plugin, based on the previous ruby plugin by shiver.
16 lines
528 B
Kotlin
16 lines
528 B
Kotlin
|
|
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)
|
|
}
|
|
} |