From 107de7551c8125fc16596c3fe2495750ab06914d Mon Sep 17 00:00:00 2001 From: Tobias Ottenweller Date: Thu, 17 May 2012 16:44:33 +0200 Subject: [PATCH] exception handling in player listener --- .../ancientgates/listeners/PluginPlayerListener.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/org/mcteam/ancientgates/listeners/PluginPlayerListener.java b/src/org/mcteam/ancientgates/listeners/PluginPlayerListener.java index 11054e9..f4789da 100644 --- a/src/org/mcteam/ancientgates/listeners/PluginPlayerListener.java +++ b/src/org/mcteam/ancientgates/listeners/PluginPlayerListener.java @@ -131,11 +131,15 @@ public class PluginPlayerListener implements Listener if (locationsAreAtSamePositions(l, blockTo.getLocation()) || locationsAreAtSamePositions(l, blockToUp.getLocation())) { // Check if the gate is still valid - g.validate(); - - if (g.isOpen()) { + try { + g.validate(); gate = g; break; + } + catch (Exception e2) { + System.out.println("gate is not valid"); + + // do nothing - gate is closed } } }