Skip to content

Commit

Permalink
Fix recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
NickAcPT committed May 20, 2021
1 parent 164d76d commit 4b0f917
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ import net.kyori.adventure.text.serializer.plain.PlainComponentSerializer
import org.geysermc.cumulus.SimpleForm
import org.geysermc.floodgate.api.FloodgateApi

class FloodgateAudience(val player: ArcadePlayer) : Audience by player.audience {
class FloodgateAudience(val player: ArcadePlayer) : Audience by player.player!! {
override fun openBook(book: Book) {

val builder = SimpleForm.builder().apply {
title(PlainComponentSerializer.plain().serialize(book.title()))
val page = book.pages().first()
Expand Down Expand Up @@ -53,7 +52,7 @@ class FloodgateAudience(val player: ArcadePlayer) : Audience by player.audience
}

override fun sendMessage(source: Identity, message: Component, type: MessageType) {
player.audience.sendMessage(source, message.replaceText {
player.player?.sendMessage(source, message.replaceText {
it.matchLiteral(" ")
it.replacement { c ->
val build = c.build()
Expand Down

0 comments on commit 4b0f917

Please sign in to comment.