diff --git a/build.gradle.kts b/build.gradle.kts index c0381862..1cec2715 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,7 +11,7 @@ var libraries = listOf() libraries = libraries + "cn.lunadeer:MinecraftPluginUtils:2.0.7" group = "cn.lunadeer" -version = "3.2.3-beta" +version = "3.2.4-beta" java { toolchain.languageVersion.set(JavaLanguageVersion.of(17)) diff --git a/v1_20_1/src/main/java/cn/lunadeer/dominion/events_v1_20_1/PlayerEvents.java b/v1_20_1/src/main/java/cn/lunadeer/dominion/events_v1_20_1/PlayerEvents.java index 740ea2b2..2ce5ee3a 100644 --- a/v1_20_1/src/main/java/cn/lunadeer/dominion/events_v1_20_1/PlayerEvents.java +++ b/v1_20_1/src/main/java/cn/lunadeer/dominion/events_v1_20_1/PlayerEvents.java @@ -162,6 +162,9 @@ public void onBlockBreak(BlockBreakEvent event) { @EventHandler(priority = EventPriority.HIGHEST) // break - item frame public void onItemFrameBreak(HangingBreakByEntityEvent event) { + if (!(event.getRemover() instanceof Player)) { + return; + } Entity entity = event.getEntity(); if (event.getCause() != HangingBreakEvent.RemoveCause.ENTITY) { return; diff --git a/v1_21_paper/src/main/java/cn/lunadeer/dominion/events_v1_21_paper/PlayerEvents.java b/v1_21_paper/src/main/java/cn/lunadeer/dominion/events_v1_21_paper/PlayerEvents.java index 8a9796b7..d9d38c46 100644 --- a/v1_21_paper/src/main/java/cn/lunadeer/dominion/events_v1_21_paper/PlayerEvents.java +++ b/v1_21_paper/src/main/java/cn/lunadeer/dominion/events_v1_21_paper/PlayerEvents.java @@ -162,6 +162,9 @@ public void onBlockBreak(BlockBreakEvent event) { @EventHandler(priority = EventPriority.HIGHEST) // break - item frame public void onItemFrameBreak(HangingBreakByEntityEvent event) { + if (!(event.getRemover() instanceof Player)) { + return; + } Entity entity = event.getEntity(); if (event.getCause() != HangingBreakEvent.RemoveCause.ENTITY) { return; diff --git a/v1_21_spigot/src/main/java/cn/lunadeer/dominion/events_v1_21_spigot/PlayerEvents.java b/v1_21_spigot/src/main/java/cn/lunadeer/dominion/events_v1_21_spigot/PlayerEvents.java index 9c6da6fc..076806cf 100644 --- a/v1_21_spigot/src/main/java/cn/lunadeer/dominion/events_v1_21_spigot/PlayerEvents.java +++ b/v1_21_spigot/src/main/java/cn/lunadeer/dominion/events_v1_21_spigot/PlayerEvents.java @@ -158,6 +158,9 @@ public void onBlockBreak(BlockBreakEvent event) { @EventHandler(priority = EventPriority.HIGHEST) // break - item frame public void onItemFrameBreak(HangingBreakByEntityEvent event) { + if (!(event.getRemover() instanceof Player)) { + return; + } Entity entity = event.getEntity(); if (event.getCause() != HangingBreakEvent.RemoveCause.ENTITY) { return;