From 53fad3360c7126fc6c866177384b47fd123d3857 Mon Sep 17 00:00:00 2001 From: TreemanKing <67459602+TreemanKing@users.noreply.github.com> Date: Wed, 18 Dec 2024 20:46:24 +1100 Subject: [PATCH] fix: on interact null pointer exceptions --- .../com/sekwah/advancedportals/spigot/Listeners.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spigot/src/main/java/com/sekwah/advancedportals/spigot/Listeners.java b/spigot/src/main/java/com/sekwah/advancedportals/spigot/Listeners.java index ed116554..a5b0c80b 100644 --- a/spigot/src/main/java/com/sekwah/advancedportals/spigot/Listeners.java +++ b/spigot/src/main/java/com/sekwah/advancedportals/spigot/Listeners.java @@ -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(),