mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-08 01:17:41 +01:00
NPE fix for #2512
This commit is contained in:
parent
37ba89a00f
commit
a15b437249
@ -84,6 +84,9 @@ public class BreakBlocksListener extends FlagListener {
|
|||||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||||
public void onPlayerInteract(final PlayerInteractEvent e)
|
public void onPlayerInteract(final PlayerInteractEvent e)
|
||||||
{
|
{
|
||||||
|
if (e.getClickedBlock() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
Location l = e.getClickedBlock().getLocation();
|
Location l = e.getClickedBlock().getLocation();
|
||||||
Material m = e.getClickedBlock().getType();
|
Material m = e.getClickedBlock().getType();
|
||||||
@ -95,7 +98,7 @@ public class BreakBlocksListener extends FlagListener {
|
|||||||
if (((CaveVinesPlant) e.getClickedBlock().getBlockData()).isBerries()) {
|
if (((CaveVinesPlant) e.getClickedBlock().getBlockData()).isBerries()) {
|
||||||
this.checkIsland(e, p, l, Flags.HARVEST);
|
this.checkIsland(e, p, l, Flags.HARVEST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case SWEET_BERRY_BUSH -> this.checkIsland(e, p, l, Flags.HARVEST);
|
case SWEET_BERRY_BUSH -> this.checkIsland(e, p, l, Flags.HARVEST);
|
||||||
case ROOTED_DIRT -> this.checkIsland(e, p, l, Flags.BREAK_BLOCKS);
|
case ROOTED_DIRT -> this.checkIsland(e, p, l, Flags.BREAK_BLOCKS);
|
||||||
default -> { // Do nothing
|
default -> { // Do nothing
|
||||||
|
Loading…
Reference in New Issue
Block a user