avoid interact entity
This commit is contained in:
TONY_All 2022-02-04 23:59:37 +08:00
parent 1385f99413
commit c76a154caa
2 changed files with 7 additions and 1 deletions

View File

@ -132,7 +132,7 @@ object InviteCodeCommands {
!InviteCode.find { InviteCodes.name eq arg }.empty()
}
}
suggestion<ConsoleCommandSender> { _, _ ->
suggestion<ConsoleCommandSender>(uncheck = true) { _, _ ->
return@suggestion Bukkit.getOnlinePlayers().map { it.name }
}
dynamic {

View File

@ -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? {