Sanity check

This commit is contained in:
fullwall 2012-10-30 22:40:15 +08:00
parent 08ef13f6c4
commit 0349b64c23

View File

@ -193,10 +193,13 @@ public class LinearWaypointProvider implements WaypointProvider {
@EventHandler(ignoreCancelled = true)
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getPlayer() == null || !event.getPlayer().equals(player)
|| event.getAction() == Action.PHYSICAL)
if (npc == null) {
end();
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;
if (event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.LEFT_CLICK_AIR) {
if (event.getClickedBlock() == null)