Skip to content

Commit

Permalink
fix CraftShulker cannot be cast to class org.bukkit.entity.Player
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdeZhang committed Dec 18, 2024
1 parent 5d2138d commit 2cbe2ff
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var libraries = listOf<String>()
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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2cbe2ff

Please sign in to comment.