Fix a null pointer exception if a certain world has no gates.
This commit is contained in:
parent
606ea1d5c5
commit
e54914bd22
@ -68,6 +68,8 @@ public class PluginPortalListener implements Listener
|
||||
Location eventLocation = event.getLocation();
|
||||
Gate closestGate = GateUtil.closestGate(eventLocation);
|
||||
|
||||
if (closestGate != null)
|
||||
{
|
||||
// Make sure gate and event locations are on the same height (y-value).
|
||||
// Otherwise the distance will be messed up when players are flying.
|
||||
// FIX ME: this could potentially let a nearby nether portal fail!
|
||||
@ -82,7 +84,7 @@ public class PluginPortalListener implements Listener
|
||||
this.currentGateAtEvent.put(player, closestGate);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
this.currentGateAtEvent.put(player, null);
|
||||
|
Loading…
x
Reference in New Issue
Block a user