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,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
}
}
}