diff --git a/src/main/kotlin/cc/maxmc/invite/command/InviteCodeCommands.kt b/src/main/kotlin/cc/maxmc/invite/command/InviteCodeCommands.kt index b7572d0..134d887 100644 --- a/src/main/kotlin/cc/maxmc/invite/command/InviteCodeCommands.kt +++ b/src/main/kotlin/cc/maxmc/invite/command/InviteCodeCommands.kt @@ -132,7 +132,7 @@ object InviteCodeCommands { !InviteCode.find { InviteCodes.name eq arg }.empty() } } - suggestion { _, _ -> + suggestion(uncheck = true) { _, _ -> return@suggestion Bukkit.getOnlinePlayers().map { it.name } } dynamic { diff --git a/src/main/kotlin/cc/maxmc/invite/listener/InvitedListener.kt b/src/main/kotlin/cc/maxmc/invite/listener/InvitedListener.kt index 15e9889..e0817c2 100644 --- a/src/main/kotlin/cc/maxmc/invite/listener/InvitedListener.kt +++ b/src/main/kotlin/cc/maxmc/invite/listener/InvitedListener.kt @@ -48,6 +48,12 @@ object InvitedListener { if (!e.message.contains("use")) e.isCancelled = true } + @SubscribeEvent + fun onInteractEntity(e: PlayerInteractEntityEvent) { + if (!cache.containsKey(e.player.uniqueId)) return + e.isCancelled = true + } + @SubscribeEvent fun onJoin(e: PlayerJoinEvent) { tailrec suspend fun requireQQNumber(player: Player): String? {