mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2025-03-09 13:19:30 +01:00
fix: on interact null pointer exceptions
This commit is contained in:
parent
e93ecd0894
commit
53fad3360c
@ -133,7 +133,17 @@ public class Listeners implements Listener {
|
||||
&& (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(),
|
||||
|
Loading…
Reference in New Issue
Block a user