Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/NearbyCraftCommandsImplementation.java [100:127]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                Vec3d blockVec = new Vec3d(furnace.getX() + 0.5, furnace.getY() + 0.5, furnace.getZ() + 0.5);

                if (headPos.squareDistanceTo(blockVec) <= 25.0) {
                    // Within a reasonable FOV?
                    // Lots of trig, let's go
                    double fov = Minecraft.getMinecraft().gameSettings.fovSetting;
                    double height = Minecraft.getMinecraft().displayHeight;
                    double width = Minecraft.getMinecraft().displayWidth;
                    Vec3d lookVec = player.getLookVec();
                    Vec3d toBlock = blockVec.subtract(headPos);

                    // Projection of block onto player look vector - if greater than 0, then in front of us
                    double scalarProjection = lookVec.dotProduct(toBlock) / lookVec.lengthVector();
                    if (scalarProjection > 0) {
                        Vec3d yUnit = new Vec3d(0, 1.0, 0);
                        Vec3d lookCross = lookVec.crossProduct(yUnit);
                        Vec3d blockProjectedOntoCross = lookCross.scale(lookCross.dotProduct(toBlock) / lookCross.lengthVector());
                        Vec3d blockProjectedOntoPlayerPlane = toBlock.subtract(blockProjectedOntoCross);
                        double xyDot = lookVec.dotProduct(blockProjectedOntoPlayerPlane);
                        double pitchTheta = Math.acos(xyDot / (lookVec.lengthVector() * blockProjectedOntoPlayerPlane.lengthVector()));

                        Vec3d playerY = lookCross.crossProduct(lookVec);
                        Vec3d blockProjectedOntoPlayerY = playerY.scale(playerY.dotProduct(toBlock) / playerY.lengthVector());
                        Vec3d blockProjectedOntoYawPlane = toBlock.subtract(blockProjectedOntoPlayerY);
                        double xzDot = lookVec.dotProduct(blockProjectedOntoYawPlane);
                        double yawTheta = Math.acos(xzDot / (lookVec.lengthVector() * blockProjectedOntoYawPlane.lengthVector()));

                        if (Math.abs(Math.toDegrees(yawTheta)) <= Math.min(1, width / height) * (fov / 2.0) && Math.abs(Math.toDegrees(pitchTheta)) <= Math.min(1, height / width) * (fov / 2.0))
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/NearbySmeltCommandsImplementation.java [99:126]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                Vec3d blockVec = new Vec3d(furnace.getX() + 0.5, furnace.getY() + 0.5, furnace.getZ() + 0.5);

                if (headPos.squareDistanceTo(blockVec) <= 25.0) {
                    // Within a reasonable FOV?
                    // Lots of trig, let's go
                    double fov = Minecraft.getMinecraft().gameSettings.fovSetting;
                    double height = Minecraft.getMinecraft().displayHeight;
                    double width = Minecraft.getMinecraft().displayWidth;
                    Vec3d lookVec = player.getLookVec();
                    Vec3d toBlock = blockVec.subtract(headPos);

                    // Projection of block onto player look vector - if greater than 0, then in front of us
                    double scalarProjection = lookVec.dotProduct(toBlock) / lookVec.lengthVector();
                    if (scalarProjection > 0) {
                        Vec3d yUnit = new Vec3d(0, 1.0, 0);
                        Vec3d lookCross = lookVec.crossProduct(yUnit);
                        Vec3d blockProjectedOntoCross = lookCross.scale(lookCross.dotProduct(toBlock) / lookCross.lengthVector());
                        Vec3d blockProjectedOntoPlayerPlane = toBlock.subtract(blockProjectedOntoCross);
                        double xyDot = lookVec.dotProduct(blockProjectedOntoPlayerPlane);
                        double pitchTheta = Math.acos(xyDot / (lookVec.lengthVector() * blockProjectedOntoPlayerPlane.lengthVector()));

                        Vec3d playerY = lookCross.crossProduct(lookVec);
                        Vec3d blockProjectedOntoPlayerY = playerY.scale(playerY.dotProduct(toBlock) / playerY.lengthVector());
                        Vec3d blockProjectedOntoYawPlane = toBlock.subtract(blockProjectedOntoPlayerY);
                        double xzDot = lookVec.dotProduct(blockProjectedOntoYawPlane);
                        double yawTheta = Math.acos(xzDot / (lookVec.lengthVector() * blockProjectedOntoYawPlane.lengthVector()));

                        if (Math.abs(Math.toDegrees(yawTheta)) <= Math.min(1, width / height) * (fov / 2.0) && Math.abs(Math.toDegrees(pitchTheta)) <= Math.min(1, height / width) * (fov / 2.0))
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



