diff --git a/plugin/src/main/kotlin/me/gabber235/typewriter/entry/cinematic/CinematicSequence.kt b/plugin/src/main/kotlin/me/gabber235/typewriter/entry/cinematic/CinematicSequence.kt index bc120362d1..9683e7602e 100644 --- a/plugin/src/main/kotlin/me/gabber235/typewriter/entry/cinematic/CinematicSequence.kt +++ b/plugin/src/main/kotlin/me/gabber235/typewriter/entry/cinematic/CinematicSequence.kt @@ -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 @@ -39,6 +40,10 @@ class CinematicSequence( e.printStackTrace() } } + + withContext(Dispatchers.IO) { + AsyncCinematicStartEvent(player).callEvent() + } } suspend fun tick() { diff --git a/plugin/src/main/kotlin/me/gabber235/typewriter/events/AsyncCinematicStartEvent.kt b/plugin/src/main/kotlin/me/gabber235/typewriter/events/AsyncCinematicStartEvent.kt new file mode 100644 index 0000000000..41b503c267 --- /dev/null +++ b/plugin/src/main/kotlin/me/gabber235/typewriter/events/AsyncCinematicStartEvent.kt @@ -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 + } +}