@@ -10,6 +10,7 @@ import com.noxcrew.interfaces.click.ClickHandler
10
10
import com.noxcrew.interfaces.click.CompletableClickHandler
11
11
import com.noxcrew.interfaces.grid.GridPoint
12
12
import com.noxcrew.interfaces.pane.PlayerPane
13
+ import com.noxcrew.interfaces.utilities.InterfacesCoroutineDetails
13
14
import com.noxcrew.interfaces.view.AbstractInterfaceView
14
15
import com.noxcrew.interfaces.view.ChestInterfaceView
15
16
import com.noxcrew.interfaces.view.InterfaceView
@@ -166,7 +167,7 @@ public class InterfacesListeners private constructor(private val plugin: Plugin)
166
167
/* * Re-opens the current background interface of [player]. */
167
168
public fun reopenInventory (player : Player ) {
168
169
getBackgroundPlayerInterface(player.uniqueId)?.also {
169
- SCOPE .launch {
170
+ SCOPE .launch( InterfacesCoroutineDetails (player.uniqueId, " reopening background interface " )) {
170
171
it.open()
171
172
}
172
173
}
@@ -272,7 +273,7 @@ public class InterfacesListeners private constructor(private val plugin: Plugin)
272
273
// Saves any persistent items stored in the given inventory before we close it
273
274
view.savePersistentItems(event.inventory)
274
275
275
- SCOPE .launch {
276
+ SCOPE .launch( InterfacesCoroutineDetails (event.player.uniqueId, " handling inventory close " )) {
276
277
// Determine if we can re-open a previous interface
277
278
val backgroundInterface = getBackgroundPlayerInterface(event.player.uniqueId)
278
279
val shouldReopen = reason in REOPEN_REASONS && ! event.player.isDead && backgroundInterface != null
@@ -542,7 +543,7 @@ public class InterfacesListeners private constructor(private val plugin: Plugin)
542
543
queries.invalidate(player.uniqueId)
543
544
544
545
// Complete the query and re-open the view
545
- SCOPE .launch {
546
+ SCOPE .launch( InterfacesCoroutineDetails (event.player.uniqueId, " completing chat query " )) {
546
547
if (query.onComplete(event.message())) {
547
548
query.view.open()
548
549
}
@@ -726,7 +727,7 @@ public class InterfacesListeners private constructor(private val plugin: Plugin)
726
727
727
728
// Remove the query, run the cancel handler, and re-open the view
728
729
queries.invalidate(playerId)
729
- SCOPE .launch {
730
+ SCOPE .launch( InterfacesCoroutineDetails (playerId, " cancelling chat query due to timeout " )) {
730
731
onCancel()
731
732
view.open()
732
733
}
@@ -743,7 +744,7 @@ public class InterfacesListeners private constructor(private val plugin: Plugin)
743
744
if (view != null && query.view != view) return
744
745
queries.invalidate(playerId)
745
746
746
- SCOPE .launch {
747
+ SCOPE .launch( InterfacesCoroutineDetails (playerId, " aborting chat query " )) {
747
748
// Run the cancellation handler
748
749
query.onCancel()
749
750
0 commit comments