mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-30 22:53:24 +01:00
Sanity check
This commit is contained in:
parent
670711f109
commit
5f6014d87d
@ -193,10 +193,13 @@ public class LinearWaypointProvider implements WaypointProvider {
|
|||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true)
|
||||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||||
if (event.getPlayer() == null || !event.getPlayer().equals(player)
|
if (npc == null) {
|
||||||
|| event.getAction() == Action.PHYSICAL)
|
end();
|
||||||
return;
|
return;
|
||||||
if (!npc.isSpawned() || event.getPlayer().getWorld() != npc.getBukkitEntity().getWorld())
|
}
|
||||||
|
if (!event.getPlayer().equals(player) || event.getAction() == Action.PHYSICAL)
|
||||||
|
return;
|
||||||
|
if (event.getPlayer().getWorld() != npc.getBukkitEntity().getWorld())
|
||||||
return;
|
return;
|
||||||
if (event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.LEFT_CLICK_AIR) {
|
if (event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.LEFT_CLICK_AIR) {
|
||||||
if (event.getClickedBlock() == null)
|
if (event.getClickedBlock() == null)
|
||||||
|
Loading…
Reference in New Issue
Block a user