From f54b1989ef55a90e95f69be6b631f04773b5d75a Mon Sep 17 00:00:00 2001 From: acrylic-style Date: Mon, 23 Oct 2023 15:30:35 +0900 Subject: [PATCH] fix: vanish check on dice --- build.gradle.kts | 2 +- .../mori01231/lifecore/listener/item/Dice1ItemListener.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8f505a8..833ab1d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ plugins { } group = "net.azisaba" -version = "6.7.9" +version = "6.7.10" java { toolchain.languageVersion.set(JavaLanguageVersion.of(8)) diff --git a/src/main/java/com/github/mori01231/lifecore/listener/item/Dice1ItemListener.kt b/src/main/java/com/github/mori01231/lifecore/listener/item/Dice1ItemListener.kt index f2d67ef..b7655c9 100644 --- a/src/main/java/com/github/mori01231/lifecore/listener/item/Dice1ItemListener.kt +++ b/src/main/java/com/github/mori01231/lifecore/listener/item/Dice1ItemListener.kt @@ -30,7 +30,7 @@ class Dice1ItemListener(val plugin: LifeCore) : Listener { e.player .getNearbyEntities(50.0, 50.0, 50.0) .filterIsInstance() - .filter { it.gameMode != GameMode.SPECTATOR && !it.hasMetadata("vanished") } + .filter { it.gameMode != GameMode.SPECTATOR && it.getMetadata("vanished").getOrNull(0)?.asBoolean() != true } .let { if (it.isEmpty()) null else it[random.nextInt(it.size)] } e.player.sendMessageToNearbyPlayers("§f§l${e.player.name}§6§lの抽選ダイスの結果は§f§l${randomPlayer?.name}§6§lさんになりました!") }