Skip to content

Commit

Permalink
Add cinematic start event
Browse files Browse the repository at this point in the history
  • Loading branch information
gabber235 committed Jan 14, 2024
1 parent c6c8369 commit ee4fc95
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import me.gabber235.typewriter.entry.entries.SystemTrigger.CINEMATIC_END
import me.gabber235.typewriter.entry.triggerEntriesFor
import me.gabber235.typewriter.entry.triggerFor
import me.gabber235.typewriter.events.AsyncCinematicEndEvent
import me.gabber235.typewriter.events.AsyncCinematicStartEvent
import me.gabber235.typewriter.events.AsyncCinematicTickEvent
import me.gabber235.typewriter.interaction.startBlockingActionBar
import me.gabber235.typewriter.interaction.startBlockingMessages
Expand Down Expand Up @@ -39,6 +40,10 @@ class CinematicSequence(
e.printStackTrace()
}
}

withContext(Dispatchers.IO) {
AsyncCinematicStartEvent(player).callEvent()
}
}

suspend fun tick() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package me.gabber235.typewriter.events

import org.bukkit.entity.Player
import org.bukkit.event.HandlerList
import org.bukkit.event.player.PlayerEvent

class AsyncCinematicStartEvent(player: Player) : PlayerEvent(player, true) {
override fun getHandlers(): HandlerList = HANDLER_LIST

companion object {
@JvmStatic
val HANDLER_LIST = HandlerList()

@JvmStatic
fun getHandlerList(): HandlerList = HANDLER_LIST
}
}

0 comments on commit ee4fc95

Please sign in to comment.