mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-24 06:06:45 +01:00
fix: PlayerInteractEvent does not necessarily interact with a block (#3463)
This commit is contained in:
parent
a003836dbc
commit
5fc153d896
@ -154,7 +154,6 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
|||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
@ -1065,9 +1064,13 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
if (area == null) {
|
if (area == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PlayerBlockEventType eventType = null;
|
PlayerBlockEventType eventType;
|
||||||
BlockType blocktype1;
|
BlockType blocktype1;
|
||||||
Block block = event.getClickedBlock();
|
Block block = event.getClickedBlock();
|
||||||
|
if (block == null) {
|
||||||
|
// We do not care in this case, the player is likely interacting with air ("nothing").
|
||||||
|
return;
|
||||||
|
}
|
||||||
Location location = BukkitUtil.adapt(block.getLocation());
|
Location location = BukkitUtil.adapt(block.getLocation());
|
||||||
Action action = event.getAction();
|
Action action = event.getAction();
|
||||||
switch (action) {
|
switch (action) {
|
||||||
|
Loading…
Reference in New Issue
Block a user