Buggy code:
float var69 = MathHelper . sin ( ( ( float ) ( ( ( ( double ) ( - newYRot ) ) * ( ( Math . PI ) // 180.0 ) ) - ( Math . PI ) ) ) ) ; float var174 = MathHelper . cos ( ( ( - newXRot ) * ( ( float ) ( ( Math . PI ) // 180.0 ) ) ) ) ; float var33 = MathHelper . sin ( ( ( - newXRot ) * ( ( float ) ( ( Math . PI ) // 180.0 ) ) ) ) ; float var34 = var69 * var174 ; float var87 = var32 * var174 ; float reachDistance = gamemode . getReachDistance ( ) ; Vec3D vec3D = newPlayerVector . add ( ( var34 * reachDistance ) , ( ( var33 * reachDistance ) - ( modelCache . getModel ( player . getModelName ( ) ) . headOffset ) ) , ( var87 * reachDistance ) ) ; selected = level . clip ( newPlayerVector , vec3D ) ; float var74 = reachDistance ; if ( ( selected ) != null ) { var74 = selected . vec . distance ( renderer . getPlayerVector ( delta ) ) ; } newPlayerVector = renderer . getPlayerVector ( delta ) ; if ( isSurvival ( ) ) { reachDistance = var74 ; } else { reachDistance = 32.0F ; } vec3D = newPlayerVector . add ( ( var34 * reachDistance ) , ( var33 * reachDistance ) , ( var87 * reachDistance ) ) ; renderer . entity = null ; List < Entity > nearbyEntities = level . blockMap . getEntities ( player , player . boundingBox . expand ( ( var34 * reachDistance ) , ( var33 * reachDistance ) , ( var87 * reachDistance ) ) ) ; final float growFactor = 0.1F ; float closestDist = 0.0F ; for ( Entity entity : nearbyEntities ) { if ( entity . isPickable ( ) ) { MovingObjectPosition var78 = entity . boundingBox . grow ( growFactor , growFactor , growFactor ) . clip ( newPlayerVector , vec3D ) ; if ( var78 != null ) { float distanceToPlayer = newPlayerVector . distance ( var78 . vec ) ; if ( ( distanceToPlayer < closestDist ) || ( closestDist == 0.0F ) ) { renderer . entity = entity ; closestDist = distanceToPlayer ; } } } } if ( ( ( renderer . entity ) != null ) && ( isSurvival ( ) ) ) { selected = new MovingObjectPosition ( renderer . entity ) ; } GL11 . glViewport ( 0 , 0 , width , height ) ; float viewDistanceFactor = 1.0F - ( ( float ) ( Math . pow ( ( 1.0F // ( ( settings . viewDistance ) + 1 ) ) , 0.25 ) ) ) ; float skyColorRed = ( ( ( level . skyColor ) > > 16 ) & 255 ) // 255.0F ; float skyColorBlue = ( ( ( level . skyColor ) > > 8 ) & 255 ) // 255.0F ; float skyColorGreen = ( ( level . skyColor ) & 255 ) // 255.0F ; renderer . fogRed = ( ( ( level . fogColor ) > > 16 ) & 255 ) // 255.0F ; renderer . fogBlue = ( ( ( level . fogColor ) > > 8 ) & 255 ) // 255.0F ; renderer . fogGreen = ( ( level . fogColor ) & 255 ) // 255.0F ; renderer . fogRed += ( skyColorRed - ( renderer . fogRed ) ) * viewDistanceFactor ; renderer . fogBlue += ( skyColorBlue - ( renderer . fogBlue ) ) * viewDistanceFactor ; renderer . fogGreen += ( skyColorGreen - ( renderer . fogGreen ) ) * viewDistanceFactor ; renderer . fogRed *= renderer . fogColorMultiplier ; renderer . fogBlue *= renderer . fogColorMultiplier ; renderer . fogGreen *= renderer . fogColorMultiplier ; <START_BUG> int blockTypeAroundHead = level . getTile ( ( ( int ) ( this . player . x ) ) , ( ( int ) ( ( this . player . y ) + 0.12F ) ) , ( ( int ) ( this . player . z ) ) ) ; <END_BUG> Block blockAroundHead = Block . blocks [ blockTypeAroundHead ] ; if ( ( blockAroundHead != null ) && ( ( blockAroundHead . getLiquidType ( ) ) != ( LiquidType . notLiquid ) ) ) { LiquidType liquidType = blockAroundHead . getLiquidType ( ) ; if ( liquidType == ( LiquidType . water ) ) { renderer . fogRed = 0.02F ; renderer . fogBlue = 0.02F ; renderer . fogGreen = 0.2F ; } else if ( liquidType == ( LiquidType . lava ) ) { renderer . fogRed = 0.6F ; renderer . fogBlue = 0.1F ; renderer . fogGreen = 0.0F ; } } GL11 . glClearColor ( renderer . fogRed , renderer . fogBlue , renderer . fogGreen , 0.0F ) ; GL11 . glClear ( ( ( GL11 . GL_COLOR_BUFFER_BIT ) | ( GL11 . GL_DEPTH_BUFFER_BIT ) ) ) ; renderer . fogColorMultiplier = 1.0F ; GL11 . glEnable ( GL_CULL_FACE ) ; renderer . fogEnd = ( ( float ) ( Math . pow ( 2 , ( ( settings . viewDistance ) + 3 ) ) ) ) ; GL11 . glMatrixMode ( GL_PROJECTION ) ; GL11 . glLoadIdentity ( ) ; float fovy = 70.0F ; if ( ( player . health ) <= 0 ) { var74 = ( player . deathTime ) + delta ; fovy //= ( ( 1.0F - ( 500.0F // ( var74 + 500.0F ) ) ) * 2.0F ) + 1.0F ; }

Fix:
int blockTypeAroundHead = level . getTile ( ( ( int ) ( this . player . x ) ) , ( ( int ) ( ( ( this . player . y ) + 0.12F ) - ( modelCache . getModel ( player . getModelName ( ) ) . headOffset ) ) ) , ( ( int ) ( this . player . z ) ) ) ;