private void processEndPortalEvent(PlayerPortalEvent event) {
		final Player player = event.getPlayer();
		final World fromWorld = player.getWorld();
		if (event.getFrom().getWorld().getEnvironment() == Environment.THE_END) {
			World mainOverworld = null;
			for (final World world : this.plugin.getServer().getWorlds()) {
				if (world.getEnvironment() == Environment.NORMAL) {
					mainOverworld = world;
					break;
				}
			}
			if (mainOverworld == null) {
				this.plugin.logSevere("The main overworld could not be found!");
				player.sendMessage(ChatColor.RED + "An internal error has occurred whilst finding the main overworld!");
				return;
			}
			Location toLoc = player.getBedSpawnLocation();
			if (toLoc == null || !mainOverworld.equals(toLoc.getWorld())) {
				toLoc = mainOverworld.getSpawnLocation();
			}
			final Location fromLocation = new Location(fromWorld, player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ(), player.getLocation().getYaw(), player.getLocation().getPitch());
			event.setTo(toLoc);
			event.setFrom(fromLocation);
			event.useTravelAgent(false);
		} else {
			World toWorld = null;
			for (final World world : this.plugin.getServer().getWorlds()) {
				if (world.getEnvironment() == Environment.THE_END) {
					toWorld = world;
					break;
				}
			}
			if (toWorld == null) {
				this.plugin.logSevere("The main end could not be found!");
				player.sendMessage(ChatColor.RED + "An internal error has occurred whilst finding the main end!");
				return;
			}
			final Location fromLocation = new Location(fromWorld, player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ(), player.getLocation().getYaw(), player.getLocation().getPitch());
			final Location toLocation = new Location(toWorld, 100, 50, 0, 90, 0);
			event.setTo(toLocation);
			event.setFrom(fromLocation);
			event.useTravelAgent(true);
		}
	}