exception handling in player listener

This commit is contained in:
Tobias Ottenweller 2012-05-17 16:44:33 +02:00
parent 7f2c85e5cc
commit 107de7551c

View File

@ -131,12 +131,16 @@ public class PluginPlayerListener implements Listener
if (locationsAreAtSamePositions(l, blockTo.getLocation()) || locationsAreAtSamePositions(l, blockToUp.getLocation())) { if (locationsAreAtSamePositions(l, blockTo.getLocation()) || locationsAreAtSamePositions(l, blockToUp.getLocation())) {
// Check if the gate is still valid // Check if the gate is still valid
g.validate(); try {
g.validate();
if (g.isOpen()) {
gate = g; gate = g;
break; break;
} }
catch (Exception e2) {
System.out.println("gate is not valid");
// do nothing - gate is closed
}
} }
} }
} }