Skip to content

Commit

Permalink
fix: on interact null pointer exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
TreemanKing authored Dec 18, 2024
1 parent e93ecd0 commit 53fad33
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,17 @@ public void onItemInteract(PlayerInteractEvent event) {
&& (event.getAction() == Action.LEFT_CLICK_BLOCK
|| event.getAction() == Action.RIGHT_CLICK_BLOCK)
&& event.getItem() != null) {

if (event.getClickedBlock() == null)
return;
if (event.getItem().getItemMeta() == null)
return;

Location blockloc = event.getClickedBlock().getLocation();

if (blockloc.getWorld() == null)
return;

boolean allowEvent = this.coreListeners.playerInteractWithBlock(
new SpigotPlayerContainer(event.getPlayer()),
event.getClickedBlock().getType().toString(),
Expand Down

0 comments on commit 53fad33

Please sign in to comment.