exception handling in player listener
This commit is contained in:
parent
7f2c85e5cc
commit
107de7551c
@ -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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user