if (event.isCancelled()) {
this.plugin.log(Level.FINE, "This Portal event was already cancelled.");
return;
}
this.plugin.log(Level.FINER, "onPlayerPortal called!");
PortalManager pm = this.plugin.getPortalManager();
Location playerPortalLoc = event.getPlayer().getLocation();
// Determine if we're in a portal
MVPortal portal = pm.getPortal(event.getPlayer(), playerPortalLoc);
Player p = event.getPlayer();
// Even if the location was null, we still have to see if
// someone wasn't exactly on (because they can do this).
if (portal == null) {
// Check around the player to make sure
playerPortalLoc = this.plugin.getCore().getSafeTTeleporter().findPortalBlockNextTo(event.getFrom());
if (playerPortalLoc != null) {
this.plugin.log(Level.FINER, "Player was outside of portal, The location has been successfully translated.");
portal = pm.getPortal(event.getPlayer(), playerPortalLoc);
}
}
if (portal != null) {
this.plugin.log(Level.FINER, "There was a portal found!");
MVDestination portalDest = portal.getDestination();