diff --git a/.github/workflows/test-building.yml b/.github/workflows/test-building.yml index d9e9c07917..f513962931 100644 --- a/.github/workflows/test-building.yml +++ b/.github/workflows/test-building.yml @@ -18,7 +18,7 @@ jobs: - name: Build Extensions uses: gradle/gradle-build-action@v2 with: - arguments: buildRelease --scan + arguments: test buildRelease --scan build-root-directory: ./extensions - name: Upload Jars as Artifacts uses: actions/upload-artifact@v3 diff --git a/documentation/docs/develop/02-extensions/08-api-changes/0.8.mdx b/documentation/docs/develop/02-extensions/08-api-changes/0.8.mdx index c7b7e086cf..ff6cf49a88 100644 --- a/documentation/docs/develop/02-extensions/08-api-changes/0.8.mdx +++ b/documentation/docs/develop/02-extensions/08-api-changes/0.8.mdx @@ -259,3 +259,22 @@ class ExampleDialogueDialogueMessenger(player: Player, context: InteractionConte } } ``` + +## Suspendable `AudienceEntry#display` + +To allow audience entries to have some async loading behaviour, the `display` now is a suspendable function. + +```kotlin showLineNumbers + @Entry("example_audience", "An example audience entry.", Colors.GREEN, "material-symbols:chat-rounded") +class ExampleAudienceEntry( + override val id: String = "", + override val name: String = "", +) : AudienceEntry { +// highlight-red + override fun display(): AudienceDisplay { +// highlight-green + override suspend fun display(): AudienceDisplay { + return ExampleAudienceDisplay() + } +} +``` diff --git a/documentation/plugins/code-snippets/snippets.json b/documentation/plugins/code-snippets/snippets.json index 00747fd7b8..eb86d167ce 100644 --- a/documentation/plugins/code-snippets/snippets.json +++ b/documentation/plugins/code-snippets/snippets.json @@ -93,11 +93,11 @@ }, "interaction_bound": { "file": "src/main/kotlin/com/typewritermc/example/entries/interaction/ExampleInteractionBound.kt", - "content": "@Entry(\"example_bound\", \"An example interaction bound\", Colors.MEDIUM_PURPLE, \"mdi:square-rounded\")\nclass ExampleBoundEntry(\n override val id: String = \"\",\n override val name: String = \"\",\n override val criteria: List = emptyList(),\n override val modifiers: List = emptyList(),\n override val triggers: List> = emptyList(),\n) : InteractionBoundEntry {\n override fun build(player: Player): InteractionBound =\n ExampleBound(player, priority)\n}\n\nclass ExampleBound(\n private val player: Player,\n override val priority: Int\n) : ListenerInteractionBound {\n\n override fun initialize() {\n super.initialize()\n // Setup initial state\n }\n\n @EventHandler(priority = EventPriority.HIGHEST)\n private fun onPlayerAction(event: SomeCancellablePlayerEvent) {\n if (event.player.uniqueId != player.uniqueId) return\n\n if (boundConditionBroken()) {\n // For PlayerEvents, we have a handy method to handle the breaking\n handleEvent(event)\n\n // A manual version of the above\n when (event.player.boundState) {\n InteractionBoundState.BLOCKING -> event.isCancelled = true\n InteractionBoundState.INTERRUPTING -> InteractionEndTrigger.triggerFor(event.player, context())\n InteractionBoundState.IGNORING -> {}\n }\n }\n }\n\n private fun boundConditionBroken(): Boolean {\n // Check if the bound condition is broken\n return false\n }\n\n override fun teardown() {\n // Cleanup any state\n super.teardown()\n }\n}" + "content": "@Entry(\"example_bound\", \"An example interaction bound\", Colors.MEDIUM_PURPLE, \"mdi:square-rounded\")\nclass ExampleBoundEntry(\n override val id: String = \"\",\n override val name: String = \"\",\n override val criteria: List = emptyList(),\n override val modifiers: List = emptyList(),\n override val triggers: List> = emptyList(),\n) : InteractionBoundEntry {\n override fun build(player: Player): InteractionBound =\n ExampleBound(player, priority)\n}\n\nclass ExampleBound(\n private val player: Player,\n override val priority: Int\n) : ListenerInteractionBound {\n\n override suspend fun initialize() {\n super.initialize()\n // Setup initial state\n }\n\n @EventHandler(priority = EventPriority.HIGHEST)\n private fun onPlayerAction(event: SomeCancellablePlayerEvent) {\n if (event.player.uniqueId != player.uniqueId) return\n\n if (boundConditionBroken()) {\n // For PlayerEvents, we have a handy method to handle the breaking\n handleEvent(event)\n\n // A manual version of the above\n when (event.player.boundState) {\n InteractionBoundState.BLOCKING -> event.isCancelled = true\n InteractionBoundState.INTERRUPTING -> InteractionEndTrigger.triggerFor(event.player, context())\n InteractionBoundState.IGNORING -> {}\n }\n }\n }\n\n private fun boundConditionBroken(): Boolean {\n // Check if the bound condition is broken\n return false\n }\n\n override suspend fun tick() {\n // Do something every tick\n }\n\n override suspend fun teardown() {\n // Cleanup any state\n super.teardown()\n }\n}" }, "audience_entry": { "file": "src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceEntry.kt", - "content": "@Entry(\"example_audience\", \"An example audience entry.\", Colors.GREEN, \"material-symbols:chat-rounded\")\nclass ExampleAudienceEntry(\n override val id: String = \"\",\n override val name: String = \"\",\n) : AudienceEntry {\n override fun display(): AudienceDisplay {\n return ExampleAudienceDisplay()\n }\n}" + "content": "@Entry(\"example_audience\", \"An example audience entry.\", Colors.GREEN, \"material-symbols:chat-rounded\")\nclass ExampleAudienceEntry(\n override val id: String = \"\",\n override val name: String = \"\",\n) : AudienceEntry {\n override suspend fun display(): AudienceDisplay {\n return ExampleAudienceDisplay()\n }\n}" }, "audience_display": { "file": "src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceEntry.kt", @@ -111,9 +111,13 @@ "file": "src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceEntry.kt", "content": "class AudienceDisplayWithEvents : AudienceDisplay() {\n override fun onPlayerAdd(player: Player) {}\n override fun onPlayerRemove(player: Player) {}\n\n // highlight-start\n @EventHandler\n fun onSomeEvent(event: SomeBukkitEvent) {\n // Do something when the event is triggered\n // This will trigger for all players, not just the ones in the audience.\n // So we need to check if the player is in the audience.\n if (event.player in this) {\n // Do something with the player\n }\n }\n // highlight-end\n}" }, + "check_player_in_audience": { + "file": "src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceEntry.kt", + "content": " if (player.inAudience(ref)) {\n // Do something with the player\n }" + }, "audience_filter_entry": { "file": "src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceFilter.kt", - "content": "@Entry(\"example_audience_filter\", \"An example audience filter.\", Colors.MYRTLE_GREEN, \"material-symbols:filter-alt\")\nclass ExampleAudienceFilterEntry(\n override val id: String = \"\",\n override val name: String = \"\",\n override val children: List> = emptyList(),\n) : AudienceFilterEntry {\n override fun display(): AudienceFilter = ExampleAudienceFilter(ref())\n}" + "content": "@Entry(\"example_audience_filter\", \"An example audience filter.\", Colors.MYRTLE_GREEN, \"material-symbols:filter-alt\")\nclass ExampleAudienceFilterEntry(\n override val id: String = \"\",\n override val name: String = \"\",\n override val children: List> = emptyList(),\n) : AudienceFilterEntry {\n override suspend fun display(): AudienceFilter = ExampleAudienceFilter(ref())\n}" }, "audience_filter": { "file": "src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceFilter.kt", @@ -125,11 +129,11 @@ }, "audience_filter_invertable": { "file": "src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceFilter.kt", - "content": "@Entry(\"inverted_example_audience_filter\", \"An example audience filter.\", Colors.MYRTLE_GREEN, \"material-symbols:filter-alt\")\nclass InvertedExampleAudienceFilterEntry(\n override val id: String = \"\",\n override val name: String = \"\",\n override val children: List> = emptyList(),\n // highlight-green\n override val inverted: Boolean = true,\n // highlight-next-line\n) : AudienceFilterEntry, Invertible {\n override fun display(): AudienceFilter = ExampleAudienceFilter(ref())\n}" + "content": "@Entry(\"inverted_example_audience_filter\", \"An example audience filter.\", Colors.MYRTLE_GREEN, \"material-symbols:filter-alt\")\nclass InvertedExampleAudienceFilterEntry(\n override val id: String = \"\",\n override val name: String = \"\",\n override val children: List> = emptyList(),\n // highlight-green\n override val inverted: Boolean = true,\n // highlight-next-line\n) : AudienceFilterEntry, Invertible {\n override suspend fun display(): AudienceFilter = ExampleAudienceFilter(ref())\n}" }, "single_filter_basic": { "file": "src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceSingleFilter.kt", - "content": "@Entry(\"example_single_filter\", \"An example single filter entry\", Colors.MYRTLE_GREEN, \"material-symbols:filter-alt\")\nclass ExampleSingleFilterEntry(\n override val id: String = \"\",\n override val name: String = \"\",\n override val priorityOverride: Optional = Optional.empty(),\n) : AudienceFilterEntry, PriorityEntry {\n override val children: List> get() = emptyList()\n\n override fun display(): AudienceFilter = ExampleSingleFilter(ref()) { player ->\n PlayerExampleDisplay(player, ExampleSingleFilter::class, ref())\n }\n}\n\nprivate class ExampleSingleFilter(\n ref: Ref,\n createDisplay: (Player) -> PlayerExampleDisplay,\n) : SingleFilter(ref, createDisplay) {\n // highlight-start\n // This must be a references to a shared map.\n // It CANNOT cache the map itself.\n override val displays: MutableMap\n get() = map\n // highlight-end\n\n // highlight-start\n companion object {\n // This map is shared between all instances of the filter.\n private val map = ConcurrentHashMap()\n }\n // highlight-end\n}\n\nprivate class PlayerExampleDisplay(\n player: Player,\n displayKClass: KClass>,\n current: Ref\n) : PlayerSingleDisplay(player, displayKClass, current) {\n override fun setup() {\n super.setup()\n player.sendMessage(\"Display activated!\")\n }\n\n override fun tearDown() {\n super.tearDown()\n player.sendMessage(\"Display deactivated!\")\n }\n}" + "content": "@Entry(\"example_single_filter\", \"An example single filter entry\", Colors.MYRTLE_GREEN, \"material-symbols:filter-alt\")\nclass ExampleSingleFilterEntry(\n override val id: String = \"\",\n override val name: String = \"\",\n override val priorityOverride: Optional = Optional.empty(),\n) : AudienceFilterEntry, PriorityEntry {\n override val children: List> get() = emptyList()\n\n override suspend fun display(): AudienceFilter = ExampleSingleFilter(ref()) { player ->\n PlayerExampleDisplay(player, ExampleSingleFilter::class, ref())\n }\n}\n\nprivate class ExampleSingleFilter(\n ref: Ref,\n createDisplay: (Player) -> PlayerExampleDisplay,\n) : SingleFilter(ref, createDisplay) {\n // highlight-start\n // This must be a references to a shared map.\n // It CANNOT cache the map itself.\n override val displays: MutableMap\n get() = map\n // highlight-end\n\n // highlight-start\n companion object {\n // This map is shared between all instances of the filter.\n private val map = ConcurrentHashMap()\n }\n // highlight-end\n}\n\nprivate class PlayerExampleDisplay(\n player: Player,\n displayKClass: KClass>,\n current: Ref\n) : PlayerSingleDisplay(player, displayKClass, current) {\n override fun setup() {\n super.setup()\n player.sendMessage(\"Display activated!\")\n }\n\n override fun tearDown() {\n super.tearDown()\n player.sendMessage(\"Display deactivated!\")\n }\n}" }, "single_filter_lifecycle": { "file": "src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceSingleFilter.kt", @@ -209,6 +213,6 @@ }, "event_entry_with_context_keys": { "file": "src/main/kotlin/com/typewritermc/example/entries/trigger/ExampleEventEntry.kt", - "content": "@Entry(\"example_event_with_context_keys\", \"An example event entry with context keys.\", Colors.YELLOW, \"material-symbols:bigtop-updates\")\n// This tells Typewriter that this entry exposes some context\n@ContextKeys(ExampleContextKeys::class)\nclass ExampleEventEntryWithContextKeys(\n override val id: String = \"\",\n override val name: String = \"\",\n override val triggers: List> = emptyList(),\n) : EventEntry\n\nenum class ExampleContextKeys(override val klass: KClass<*>) : EntryContextKey {\n // The two `String::class` have to be the same.\n // The @KeyType is for the panel to know\n @KeyType(String::class)\n // The type here is for casting during runtime\n TEXT(String::class),\n\n @KeyType(Int::class)\n NUMBER(Int::class),\n\n // More complex types are also allowed.\n @KeyType(Position::class)\n POSITION(Position::class)\n}\n\n@EntryListener(ExampleEventEntryWithContextKeys::class)\nfun onEventAddContext(event: SomeBukkitEvent, query: Query) {\n val entries = query.find()\n entries.triggerAllFor(event.player) {\n // Make sure these values are drawn from the event.\n // You MUST supply all the context keys.\n ExampleContextKeys.TEXT withValue \"Hello World\"\n ExampleContextKeys.NUMBER withValue 42\n ExampleContextKeys.POSITION withValue Position.ORIGIN\n }\n}" + "content": "@Entry(\"example_event_with_context_keys\", \"An example event entry with context keys.\", Colors.YELLOW, \"material-symbols:bigtop-updates\")\n// This tells Typewriter that this entry exposes some context\n// highlight-next-line\n@ContextKeys(ExampleContextKeys::class)\nclass ExampleEventEntryWithContextKeys(\n override val id: String = \"\",\n override val name: String = \"\",\n override val triggers: List> = emptyList(),\n) : EventEntry\n\n// highlight-start\nenum class ExampleContextKeys(override val klass: KClass<*>) : EntryContextKey {\n // The two `String::class` have to be the same.\n // The @KeyType is for the panel to know\n @KeyType(String::class)\n // The type here is for casting during runtime\n TEXT(String::class),\n\n @KeyType(Int::class)\n NUMBER(Int::class),\n\n // More complex types are also allowed.\n @KeyType(Position::class)\n POSITION(Position::class)\n}\n// highlight-end\n\n@EntryListener(ExampleEventEntryWithContextKeys::class)\nfun onEventAddContext(event: SomeBukkitEvent, query: Query) {\n val entries = query.find()\n // highlight-start\n entries.triggerAllFor(event.player) {\n // Make sure these values are drawn from the event.\n // You MUST supply all the context keys.\n ExampleContextKeys.TEXT withValue \"Hello World\"\n ExampleContextKeys.NUMBER withValue 42\n ExampleContextKeys.POSITION withValue Position.ORIGIN\n }\n // highlight-end\n}" } } \ No newline at end of file diff --git a/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entity/AdvancedEntity.kt b/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entity/AdvancedEntity.kt index bb6e1b2b40..14e6dead4c 100644 --- a/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entity/AdvancedEntity.kt +++ b/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entity/AdvancedEntity.kt @@ -18,7 +18,7 @@ interface SharedAdvancedEntityInstance : EntityInstanceEntry { @WithRotation val spawnLocation: Position - override fun display(): AudienceFilter { + override suspend fun display(): AudienceFilter { val activityCreator = this.activity.get() ?: IdleActivity val (definition, suppliers) = baseInfo() ?: return PassThroughFilter(ref()) @@ -42,7 +42,7 @@ interface GroupAdvancedEntityInstance : EntityInstanceEntry { @Help("The group that this entity instance belongs to.") val group: Ref - override fun display(): AudienceFilter { + override suspend fun display(): AudienceFilter { val activityCreator = this.activity.get() ?: IdleActivity val group = this.group.get() ?: throw IllegalStateException("No group found for the group entity instance.") @@ -59,7 +59,7 @@ interface IndividualAdvancedEntityInstance : EntityInstanceEntry { @WithRotation val spawnLocation: Var - override fun display(): AudienceFilter { + override suspend fun display(): AudienceFilter { val activityCreator = this.activity.get() ?: IdleActivity val (definition, suppliers) = baseInfo() ?: return PassThroughFilter(ref()) diff --git a/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entity/SimpleEntity.kt b/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entity/SimpleEntity.kt index e3563c7075..f75db48818 100644 --- a/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entity/SimpleEntity.kt +++ b/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entity/SimpleEntity.kt @@ -27,7 +27,7 @@ interface SimpleEntityInstance : EntityInstanceEntry { override val children: List> get() = data - override fun display(): AudienceFilter { + override suspend fun display(): AudienceFilter { val definition = definition.get().logErrorIfNull("You must specify a definition for $name") ?: return PassThroughFilter(ref()) diff --git a/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entries/AudienceEntry.kt b/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entries/AudienceEntry.kt index 77dc7e25af..8048426462 100644 --- a/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entries/AudienceEntry.kt +++ b/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entries/AudienceEntry.kt @@ -26,7 +26,7 @@ annotation class ChildOnly @Tags("audience") interface AudienceEntry : ManifestEntry, PlaceholderEntry { - fun display(): AudienceDisplay + suspend fun display(): AudienceDisplay override fun parser() = placeholderParser { literal("players") { @@ -43,7 +43,7 @@ interface AudienceEntry : ManifestEntry, PlaceholderEntry { @Tags("audience_filter") interface AudienceFilterEntry : AudienceEntry { val children: List> - override fun display(): AudienceFilter + override suspend fun display(): AudienceFilter } interface Invertible { diff --git a/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entries/EntityEntry.kt b/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entries/EntityEntry.kt index 2f46412a88..7093ab939b 100644 --- a/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entries/EntityEntry.kt +++ b/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entries/EntityEntry.kt @@ -52,7 +52,7 @@ interface PropertyCollector

{ @Tags("entity_data") interface EntityData

: AudienceEntry, PropertySupplier

, PriorityEntry { override fun canApply(player: Player): Boolean = player.inAudience(this) - override fun display(): AudienceDisplay = PassThroughDisplay() + override suspend fun display(): AudienceDisplay = PassThroughDisplay() } @Tags("generic_entity_data") diff --git a/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entries/SidebarEntry.kt b/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entries/SidebarEntry.kt index 9f9926baff..fd805b85db 100644 --- a/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entries/SidebarEntry.kt +++ b/engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/entries/SidebarEntry.kt @@ -43,7 +43,7 @@ interface SidebarEntry : AudienceFilterEntry, PlaceholderEntry, PriorityEntry { supply { player -> display(player) } } - override fun display(): AudienceFilter = SidebarFilter(ref()) { player -> + override suspend fun display(): AudienceFilter = SidebarFilter(ref()) { player -> PlayerSidebarDisplay(player, SidebarFilter::class, ref()) } } diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/BossBarEntry.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/BossBarEntry.kt index 1845dd96a4..3ed2bcbd98 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/BossBarEntry.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/BossBarEntry.kt @@ -37,7 +37,7 @@ class BossBarEntry( @Help("Any flags to apply to the boss bar") val flags: List = emptyList(), ) : AudienceEntry { - override fun display(): AudienceDisplay { + override suspend fun display(): AudienceDisplay { return BossBarDisplay(title, progress, color, style, flags) } } diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/CinematicAudienceEntry.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/CinematicAudienceEntry.kt index b256573023..34c7fe39d2 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/CinematicAudienceEntry.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/CinematicAudienceEntry.kt @@ -42,7 +42,7 @@ class CinematicAudienceEntry( val pageId: String = "", override val inverted: Boolean = false ) : AudienceFilterEntry, Invertible { - override fun display(): AudienceFilter = CinematicAudienceFilter( + override suspend fun display(): AudienceFilter = CinematicAudienceFilter( ref(), pageId, ) diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/CinematicSkippableAudienceEntry.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/CinematicSkippableAudienceEntry.kt index ebcd12436e..de191ba76c 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/CinematicSkippableAudienceEntry.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/CinematicSkippableAudienceEntry.kt @@ -38,7 +38,7 @@ class CinematicSkippableAudienceEntry( override val children: List> = emptyList(), override val inverted: Boolean = false, ) : AudienceFilterEntry, Invertible, PlaceholderEntry { - override fun display(): AudienceFilter { + override suspend fun display(): AudienceFilter { return CinematicSkippableAudienceDisplay(ref()) } diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/CriteriaAudience.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/CriteriaAudience.kt index 26aaf94a78..74367b141d 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/CriteriaAudience.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/CriteriaAudience.kt @@ -28,7 +28,7 @@ class CriteriaAudience( val criteria: List = emptyList(), override val inverted: Boolean = false, ) : AudienceFilterEntry, Invertible { - override fun display(): AudienceFilter = CriteriaAudienceFilter(ref(), criteria) + override suspend fun display(): AudienceFilter = CriteriaAudienceFilter(ref(), criteria) } class CriteriaAudienceFilter( diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/CronAudience.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/CronAudience.kt index b69ff313db..37521583c3 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/CronAudience.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/CronAudience.kt @@ -34,7 +34,7 @@ class CronAudience( // The Cron Expression when the fact expires. val cron: CronExpression = CronExpression.default(), ) : AudienceFilterEntry { - override fun display(): AudienceFilter { + override suspend fun display(): AudienceFilter { return CronAudienceDisplay(ref(), cron) } } diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/ExperienceAudienceEntry.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/ExperienceAudienceEntry.kt index 1b0822912b..7a03dea4d2 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/ExperienceAudienceEntry.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/ExperienceAudienceEntry.kt @@ -55,7 +55,7 @@ class ExperienceAudienceEntry( override val priorityOverride: Optional = Optional.empty() ) : AudienceFilterEntry, PriorityEntry { override val children: List> get() = emptyList() - override fun display(): AudienceFilter = ExpAudienceFilter(ref()) { player -> + override suspend fun display(): AudienceFilter = ExpAudienceFilter(ref()) { player -> PlayerExpDisplay(player, ExpAudienceFilter::class, ref(), experience, levelRequirement) } } diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/FreezeTimeAudienceEntry.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/FreezeTimeAudienceEntry.kt index e994b5a0fc..376e0032fa 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/FreezeTimeAudienceEntry.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/FreezeTimeAudienceEntry.kt @@ -40,7 +40,7 @@ class FreezeTimeAudienceEntry( override val name: String = "", val time: Var = ConstVar(0), ) : AudienceEntry { - override fun display(): AudienceDisplay = FreezeTimeAudienceDisplay(time) + override suspend fun display(): AudienceDisplay = FreezeTimeAudienceDisplay(time) } class FreezeTimeAudienceDisplay( diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/GameTimeAudienceEntry.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/GameTimeAudienceEntry.kt index f09c5ab311..3448291787 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/GameTimeAudienceEntry.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/GameTimeAudienceEntry.kt @@ -41,7 +41,7 @@ class GameTimeAudienceEntry( val activeTimes: List = emptyList(), override val inverted: Boolean = false, ) : AudienceFilterEntry, Invertible { - override fun display(): AudienceFilter = GameTimeAudienceFilter(ref(), activeTimes) + override suspend fun display(): AudienceFilter = GameTimeAudienceFilter(ref(), activeTimes) } class GameTimeAudienceFilter( diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/HoldingItemAudienceEntry.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/HoldingItemAudienceEntry.kt index 5274b85fce..2b05d8d371 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/HoldingItemAudienceEntry.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/HoldingItemAudienceEntry.kt @@ -36,7 +36,7 @@ class HoldingItemAudienceEntry( val item: Var = ConstVar(Item.Empty), override val inverted: Boolean = false, ) : AudienceFilterEntry, Invertible { - override fun display(): AudienceFilter = HoldingItemAudienceFilter(ref(), item) + override suspend fun display(): AudienceFilter = HoldingItemAudienceFilter(ref(), item) } class HoldingItemAudienceFilter( diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/ItemInInventoryAudienceEntry.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/ItemInInventoryAudienceEntry.kt index 1f0e9c1d5b..8446902456 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/ItemInInventoryAudienceEntry.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/ItemInInventoryAudienceEntry.kt @@ -27,7 +27,7 @@ class ItemInInventoryAudienceEntry( val item: Var = ConstVar(Item.Empty), override val inverted: Boolean = false, ) : AudienceFilterEntry, Invertible { - override fun display(): AudienceFilter = ItemInInventoryAudienceFilter(ref(), item) + override suspend fun display(): AudienceFilter = ItemInInventoryAudienceFilter(ref(), item) } class ItemInInventoryAudienceFilter( diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/ItemInSlotAudienceEntry.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/ItemInSlotAudienceEntry.kt index 0fe519887e..676b5f6b8f 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/ItemInSlotAudienceEntry.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/ItemInSlotAudienceEntry.kt @@ -31,7 +31,7 @@ class ItemInSlotAudienceEntry( val slot: Var = ConstVar(0), override val inverted: Boolean = false, ) : AudienceFilterEntry, Invertible { - override fun display(): AudienceFilter = ItemInSlotAudienceFilter(ref(), item, slot) + override suspend fun display(): AudienceFilter = ItemInSlotAudienceFilter(ref(), item, slot) } class ItemInSlotAudienceFilter( diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/ItemSlotBinderAudienceEntry.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/ItemSlotBinderAudienceEntry.kt index 4842ab5205..f845c4ae78 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/ItemSlotBinderAudienceEntry.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/ItemSlotBinderAudienceEntry.kt @@ -53,7 +53,7 @@ class ItemSlotBinderAudienceEntry( override val children: List> get() = emptyList() - override fun display(): AudienceFilter { + override suspend fun display(): AudienceFilter { return ItemSlotBinderAudience(slot, ref()) { player -> ItemSlotBinderDisplay(player, slot.get(player), ItemSlotBinderAudience::class, ref()) } diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/LoopingCinematicAudience.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/LoopingCinematicAudience.kt index a25a19a54a..5d332e7177 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/LoopingCinematicAudience.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/LoopingCinematicAudience.kt @@ -40,7 +40,7 @@ class LoopingCinematicAudience( @Page(PageType.CINEMATIC) val cinematicId: String = "", ) : AudienceEntry { - override fun display(): AudienceDisplay { + override suspend fun display(): AudienceDisplay { val entries = Query.findWhereFromPage(cinematicId) { true }.toList() val inValidEntries = entries.filterIsInstance().map { it.name } diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/PotionEffectAudienceEntry.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/PotionEffectAudienceEntry.kt index 43c4b255ab..f4b69d3310 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/PotionEffectAudienceEntry.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/PotionEffectAudienceEntry.kt @@ -34,7 +34,7 @@ class PotionEffectAudienceEntry( @Default("true") val icon: Boolean = true, ) : AudienceEntry { - override fun display(): AudienceDisplay { + override suspend fun display(): AudienceDisplay { return PotionEffectAudienceDisplay(potionEffect, strength, ambient, particles, icon) } } diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/TabListHeaderFooterEntry.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/TabListHeaderFooterEntry.kt index f89858b1c0..dc87dc391b 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/TabListHeaderFooterEntry.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/TabListHeaderFooterEntry.kt @@ -42,7 +42,7 @@ class TabListHeaderFooterEntry( override val children: List> get() = header + footer - override fun display(): AudienceFilter = TabListHeaderFooterFilter(ref()) { player -> + override suspend fun display(): AudienceFilter = TabListHeaderFooterFilter(ref()) { player -> PlayerTabListHeaderFooter(player, TabListHeaderFooterFilter::class, ref()) } } diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/TimerAudienceEntry.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/TimerAudienceEntry.kt index c3a3c56646..1c65f2e4dd 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/TimerAudienceEntry.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/TimerAudienceEntry.kt @@ -41,7 +41,7 @@ class TimerAudienceEntry( val duration: Var = ConstVar(Duration.ofSeconds(1)), val onTimer: Ref = emptyRef(), ) : AudienceEntry { - override fun display(): AudienceDisplay = TimerAudienceDisplay(duration, onTimer) + override suspend fun display(): AudienceDisplay = TimerAudienceDisplay(duration, onTimer) } class TimerAudienceDisplay( diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/TriggerAudienceEntry.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/TriggerAudienceEntry.kt index 17760cca2b..003104a163 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/TriggerAudienceEntry.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/TriggerAudienceEntry.kt @@ -32,7 +32,7 @@ class TriggerAudienceEntry( @Help("The sequence to trigger when the player exits the audience.") val onExit: Ref = emptyRef(), ) : AudienceEntry { - override fun display(): AudienceDisplay = TriggerAudienceDisplay(onEnter, onExit) + override suspend fun display(): AudienceDisplay = TriggerAudienceDisplay(onEnter, onExit) } class TriggerAudienceDisplay( diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/WeatherAudienceEntry.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/WeatherAudienceEntry.kt index 431c3ac55e..06efcb4327 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/WeatherAudienceEntry.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/WeatherAudienceEntry.kt @@ -23,7 +23,7 @@ class WeatherAudienceEntry( override val name: String = "", val weather: Var = ConstVar(WeatherType.DOWNFALL), ) : AudienceEntry { - override fun display(): AudienceDisplay = WeatherAudienceDisplay(weather) + override suspend fun display(): AudienceDisplay = WeatherAudienceDisplay(weather) } class WeatherAudienceDisplay( diff --git a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/WorldAudienceEntry.kt b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/WorldAudienceEntry.kt index f564feda57..c9e4acab42 100644 --- a/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/WorldAudienceEntry.kt +++ b/extensions/BasicExtension/src/main/kotlin/com/typewritermc/basic/entries/audience/WorldAudienceEntry.kt @@ -24,7 +24,7 @@ class WorldAudienceEntry( @Regex val world: Var = ConstVar(""), ) : AudienceFilterEntry { - override fun display(): AudienceFilter = WorldAudienceFilter(ref(), world) + override suspend fun display(): AudienceFilter = WorldAudienceFilter(ref(), world) } class WorldAudienceFilter( diff --git a/extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/audience/DirectEntityInstancePathStream.kt b/extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/audience/DirectEntityInstancePathStream.kt index 82cbcf359f..a643601e85 100644 --- a/extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/audience/DirectEntityInstancePathStream.kt +++ b/extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/audience/DirectEntityInstancePathStream.kt @@ -33,7 +33,7 @@ class DirectEntityInstancePathStream( val road: Ref = emptyRef(), val target: Ref = emptyRef(), ) : AudienceEntry { - override fun display(): AudienceDisplay { + override suspend fun display(): AudienceDisplay { val manager = KoinJavaComponent.get(AudienceManager::class.java) val entityDisplay = manager[target] as? ActivityEntityDisplay return PathStreamDisplay(road, endLocation = { entityDisplay?.position(it.uniqueId)?.toBukkitLocation() ?: it.location }) diff --git a/extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/quest/InteractEntityObjectivesPathStream.kt b/extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/quest/InteractEntityObjectivesPathStream.kt index 0eda274dab..5bfa617696 100644 --- a/extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/quest/InteractEntityObjectivesPathStream.kt +++ b/extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/quest/InteractEntityObjectivesPathStream.kt @@ -38,7 +38,7 @@ class InteractEntityObjectivesPathStream( val road: Ref = emptyRef(), val ignoreInstances: List> = emptyList(), ) : AudienceEntry { - override fun display(): AudienceDisplay = MultiPathStreamDisplay(road, endLocations = { player -> + override suspend fun display(): AudienceDisplay = MultiPathStreamDisplay(road, endLocations = { player -> val definitions = player.trackedShowingObjectives().filterIsInstance().map { it.entity } val manager = KoinJavaComponent.get(AudienceManager::class.java) diff --git a/extensions/QuestExtension/src/main/kotlin/com/typewritermc/quest/QuestEntry.kt b/extensions/QuestExtension/src/main/kotlin/com/typewritermc/quest/QuestEntry.kt index 629bf2eb58..3d8a0ca22d 100644 --- a/extensions/QuestExtension/src/main/kotlin/com/typewritermc/quest/QuestEntry.kt +++ b/extensions/QuestExtension/src/main/kotlin/com/typewritermc/quest/QuestEntry.kt @@ -40,7 +40,7 @@ interface QuestEntry : AudienceFilterEntry, PlaceholderEntry { supplyPlayer { player -> display(player) } } - override fun display(): AudienceFilter = QuestAudienceFilter( + override suspend fun display(): AudienceFilter = QuestAudienceFilter( ref() ) } @@ -73,7 +73,7 @@ interface ObjectiveEntry : AudienceFilterEntry, PlaceholderEntry, PriorityEntry @Placeholder val display: Var - override fun display(): AudienceFilter { + override suspend fun display(): AudienceFilter { return ObjectiveAudienceFilter( ref(), criteria, diff --git a/extensions/QuestExtension/src/main/kotlin/com/typewritermc/quest/entries/audience/LocationObjectivesPathStream.kt b/extensions/QuestExtension/src/main/kotlin/com/typewritermc/quest/entries/audience/LocationObjectivesPathStream.kt index 58a6c19814..d71d5a2731 100644 --- a/extensions/QuestExtension/src/main/kotlin/com/typewritermc/quest/entries/audience/LocationObjectivesPathStream.kt +++ b/extensions/QuestExtension/src/main/kotlin/com/typewritermc/quest/entries/audience/LocationObjectivesPathStream.kt @@ -29,7 +29,7 @@ class LocationObjectivesPathStream( override val name: String = "", val road: Ref = emptyRef(), ) : AudienceEntry { - override fun display(): AudienceDisplay = MultiPathStreamDisplay(road, endLocations = { player -> + override suspend fun display(): AudienceDisplay = MultiPathStreamDisplay(road, endLocations = { player -> player.trackedShowingObjectives().filterIsInstance() .map { it.targetLocation.get(player).toBukkitLocation() }.toList() }) diff --git a/extensions/QuestExtension/src/main/kotlin/com/typewritermc/quest/entries/audience/TrackedObjectiveAudience.kt b/extensions/QuestExtension/src/main/kotlin/com/typewritermc/quest/entries/audience/TrackedObjectiveAudience.kt index fc773c3c85..ee8c0022f0 100644 --- a/extensions/QuestExtension/src/main/kotlin/com/typewritermc/quest/entries/audience/TrackedObjectiveAudience.kt +++ b/extensions/QuestExtension/src/main/kotlin/com/typewritermc/quest/entries/audience/TrackedObjectiveAudience.kt @@ -29,7 +29,7 @@ class TrackedObjectiveAudience( override val children: List> = emptyList(), override val inverted: Boolean = false, ) : AudienceFilterEntry, Invertible { - override fun display(): AudienceFilter = TrackedObjectiveAudienceFilter( + override suspend fun display(): AudienceFilter = TrackedObjectiveAudienceFilter( ref() ) } diff --git a/extensions/QuestExtension/src/main/kotlin/com/typewritermc/quest/entries/audience/TrackedQuestAudience.kt b/extensions/QuestExtension/src/main/kotlin/com/typewritermc/quest/entries/audience/TrackedQuestAudience.kt index a8585bb8ca..1aaa114f96 100644 --- a/extensions/QuestExtension/src/main/kotlin/com/typewritermc/quest/entries/audience/TrackedQuestAudience.kt +++ b/extensions/QuestExtension/src/main/kotlin/com/typewritermc/quest/entries/audience/TrackedQuestAudience.kt @@ -39,7 +39,7 @@ class TrackedQuestAudience( val quest: Ref = emptyRef(), override val inverted: Boolean = false, ) : AudienceFilterEntry, Invertible { - override fun display(): AudienceFilter = TrackedQuestAudienceFilter( + override suspend fun display(): AudienceFilter = TrackedQuestAudienceFilter( ref(), quest ) diff --git a/extensions/RoadNetworkExtension/src/main/kotlin/com/typewritermc/roadnetwork/entries/ClosestGroupMemberPathStream.kt b/extensions/RoadNetworkExtension/src/main/kotlin/com/typewritermc/roadnetwork/entries/ClosestGroupMemberPathStream.kt index 51f8da66da..011e2a1b1f 100644 --- a/extensions/RoadNetworkExtension/src/main/kotlin/com/typewritermc/roadnetwork/entries/ClosestGroupMemberPathStream.kt +++ b/extensions/RoadNetworkExtension/src/main/kotlin/com/typewritermc/roadnetwork/entries/ClosestGroupMemberPathStream.kt @@ -34,7 +34,7 @@ class ClosestGroupMemberPathStream( val road: Ref = emptyRef(), val group: Ref = emptyRef(), ) : AudienceEntry { - override fun display(): AudienceDisplay = PathStreamDisplay(road) { player -> + override suspend fun display(): AudienceDisplay = PathStreamDisplay(road) { player -> group.get()?.group(player)?.players ?.asSequence() ?.filter { it != player } diff --git a/extensions/RoadNetworkExtension/src/main/kotlin/com/typewritermc/roadnetwork/entries/DirectLocationPathStream.kt b/extensions/RoadNetworkExtension/src/main/kotlin/com/typewritermc/roadnetwork/entries/DirectLocationPathStream.kt index df8c2ed894..6937fab49b 100644 --- a/extensions/RoadNetworkExtension/src/main/kotlin/com/typewritermc/roadnetwork/entries/DirectLocationPathStream.kt +++ b/extensions/RoadNetworkExtension/src/main/kotlin/com/typewritermc/roadnetwork/entries/DirectLocationPathStream.kt @@ -29,5 +29,5 @@ class DirectLocationPathStream( val road: Ref = emptyRef(), val targetLocation: Var = ConstVar(Position.ORIGIN), ) : AudienceEntry { - override fun display(): AudienceDisplay = PathStreamDisplay(road, endLocation = { targetLocation.get(it).toBukkitLocation() }) + override suspend fun display(): AudienceDisplay = PathStreamDisplay(road, endLocation = { targetLocation.get(it).toBukkitLocation() }) } \ No newline at end of file diff --git a/extensions/RoadNetworkExtension/src/main/kotlin/com/typewritermc/roadnetwork/entries/GroupMembersPathStream.kt b/extensions/RoadNetworkExtension/src/main/kotlin/com/typewritermc/roadnetwork/entries/GroupMembersPathStream.kt index 48f2e4dc65..05c074b9ae 100644 --- a/extensions/RoadNetworkExtension/src/main/kotlin/com/typewritermc/roadnetwork/entries/GroupMembersPathStream.kt +++ b/extensions/RoadNetworkExtension/src/main/kotlin/com/typewritermc/roadnetwork/entries/GroupMembersPathStream.kt @@ -32,7 +32,7 @@ class GroupMembersPathStream( val road: Ref = emptyRef(), val group: Ref = emptyRef(), ) : AudienceEntry { - override fun display(): AudienceDisplay = MultiPathStreamDisplay(road, endLocations = { player -> + override suspend fun display(): AudienceDisplay = MultiPathStreamDisplay(road, endLocations = { player -> group.get()?.group(player)?.players ?.filter { it != player } ?.map { it.location } diff --git a/extensions/WorldGuardExtension/src/main/kotlin/com/typewritermc/worldguard/entries/audience/RegionAudienceEntry.kt b/extensions/WorldGuardExtension/src/main/kotlin/com/typewritermc/worldguard/entries/audience/RegionAudienceEntry.kt index 6d7707c9b3..358392c7f1 100644 --- a/extensions/WorldGuardExtension/src/main/kotlin/com/typewritermc/worldguard/entries/audience/RegionAudienceEntry.kt +++ b/extensions/WorldGuardExtension/src/main/kotlin/com/typewritermc/worldguard/entries/audience/RegionAudienceEntry.kt @@ -35,8 +35,7 @@ class RegionAudienceEntry( val region: String = "", override val inverted: Boolean = false, ) : AudienceFilterEntry, Invertible { - override fun display(): AudienceFilter { - + override suspend fun display(): AudienceFilter { return RegionAudienceFilter(ref(), region) } } diff --git a/extensions/_DocsExtension/src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceEntry.kt b/extensions/_DocsExtension/src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceEntry.kt index defe8b4d3e..9a1bcefd80 100644 --- a/extensions/_DocsExtension/src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceEntry.kt +++ b/extensions/_DocsExtension/src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceEntry.kt @@ -19,7 +19,7 @@ class ExampleAudienceEntry( override val id: String = "", override val name: String = "", ) : AudienceEntry { - override fun display(): AudienceDisplay { + override suspend fun display(): AudienceDisplay { return ExampleAudienceDisplay() } } diff --git a/extensions/_DocsExtension/src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceFilter.kt b/extensions/_DocsExtension/src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceFilter.kt index 717b50c0d7..07d701e14d 100644 --- a/extensions/_DocsExtension/src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceFilter.kt +++ b/extensions/_DocsExtension/src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceFilter.kt @@ -16,7 +16,7 @@ class ExampleAudienceFilterEntry( override val name: String = "", override val children: List> = emptyList(), ) : AudienceFilterEntry { - override fun display(): AudienceFilter = ExampleAudienceFilter(ref()) + override suspend fun display(): AudienceFilter = ExampleAudienceFilter(ref()) } // @@ -74,6 +74,6 @@ class InvertedExampleAudienceFilterEntry( override val inverted: Boolean = true, // highlight-next-line ) : AudienceFilterEntry, Invertible { - override fun display(): AudienceFilter = ExampleAudienceFilter(ref()) + override suspend fun display(): AudienceFilter = ExampleAudienceFilter(ref()) } // \ No newline at end of file diff --git a/extensions/_DocsExtension/src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceSingleFilter.kt b/extensions/_DocsExtension/src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceSingleFilter.kt index f94d24f4d6..dfb38725ee 100644 --- a/extensions/_DocsExtension/src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceSingleFilter.kt +++ b/extensions/_DocsExtension/src/main/kotlin/com/typewritermc/example/entries/manifest/ExampleAudienceSingleFilter.kt @@ -22,7 +22,7 @@ class ExampleSingleFilterEntry( ) : AudienceFilterEntry, PriorityEntry { override val children: List> get() = emptyList() - override fun display(): AudienceFilter = ExampleSingleFilter(ref()) { player -> + override suspend fun display(): AudienceFilter = ExampleSingleFilter(ref()) { player -> PlayerExampleDisplay(player, ExampleSingleFilter::class, ref()) } }